File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -178,9 +178,18 @@ export async function testByRole() {
178
178
console . assert ( queryByRole ( element , 'button' , { name : / ^ L o g / } ) === null )
179
179
console . assert (
180
180
queryByRole ( element , 'button' , {
181
- name : ( name , el ) => name === 'Login' && ! ! el ? .hasAttribute ( 'disabled' ) ,
181
+ name : ( name , el ) => name === 'Login' && el . hasAttribute ( 'disabled' ) ,
182
182
} ) === null ,
183
183
)
184
+
185
+ // @ts -expect-error: allow to query for a role that isn't included in the types
186
+ console . assert ( queryByRole ( element , 'foo' ) === null )
187
+ // @ts -expect-error: allow to query for a role that isn't included in the types
188
+ console . assert ( queryByRole ( element , / f o o / ) === null )
189
+ // @ts -expect-error: allow to query for a role that isn't included in the types
190
+ console . assert ( screen . queryByRole ( 'foo' ) === null )
191
+ // @ts -expect-error: allow to query for a role that isn't included in the types
192
+ console . assert ( screen . queryByRole ( / f o o / ) === null )
184
193
}
185
194
186
195
export function testA11yHelper ( ) {
You can’t perform that action at this time.
0 commit comments