@@ -214,8 +214,7 @@ test('can be filtered by accessible name', () => {
214
214
expect ( deliveryForm ) . not . toBeNull ( )
215
215
216
216
expect (
217
- // TODO: upstream bug in `aria-query`; should be `button` role
218
- getQueriesForElement ( deliveryForm ) . getByRole ( 'textbox' , { name : 'Submit' } ) ,
217
+ getQueriesForElement ( deliveryForm ) . getByRole ( 'button' , { name : 'Submit' } ) ,
219
218
) . not . toBeNull ( )
220
219
221
220
const invoiceForm = getByRole ( 'form' , { name : 'Delivery Adress' } )
@@ -229,11 +228,9 @@ test('can be filtered by accessible name', () => {
229
228
test ( 'accessible name comparison is case sensitive' , ( ) => {
230
229
const { getByRole} = render ( `<h1>Sign <em>up</em></h1>` )
231
230
232
- // actual: "Sign up",
233
- // queried: "Sign Up"
234
- expect ( ( ) => getByRole ( 'heading' , { name : 'Sign Up' } ) )
231
+ expect ( ( ) => getByRole ( 'heading' , { name : 'something that does not match' } ) )
235
232
. toThrowErrorMatchingInlineSnapshot ( `
236
- "Unable to find an accessible element with the role "heading" and name "Sign Up "
233
+ "Unable to find an accessible element with the role "heading" and name "something that does not match "
237
234
238
235
Here are the accessible roles:
239
236
@@ -277,9 +274,9 @@ test('accessible name filter implements TextMatch', () => {
277
274
test ( 'TextMatch serialization in error message' , ( ) => {
278
275
const { getByRole} = render ( `<h1>Sign <em>up</em></h1>` )
279
276
280
- expect ( ( ) => getByRole ( 'heading' , { name : / L o g i n / } ) )
277
+ expect ( ( ) => getByRole ( 'heading' , { name : / s o m e t h i n g t h a t d o e s n o t m a t c h / } ) )
281
278
. toThrowErrorMatchingInlineSnapshot ( `
282
- "Unable to find an accessible element with the role "heading" and name \`/Login /\`
279
+ "Unable to find an accessible element with the role "heading" and name \`/something that does not match /\`
283
280
284
281
Here are the accessible roles:
285
282
0 commit comments