@@ -390,18 +390,21 @@ test('accessible regex name in error message for multiple found', () => {
390
390
391
391
expect ( ( ) => getByRole ( 'button' , { name : / v a l u e / i} ) )
392
392
. toThrowErrorMatchingInlineSnapshot ( `
393
- "Found multiple elements with the role "button"
393
+ "Found multiple elements with the role "button" and name \`/value/i\`
394
394
395
395
Here are the matching elements:
396
396
397
397
<button>
398
398
Increment value
399
399
</button>
400
400
401
+ <button>
402
+ Decrement value
403
+ </button>
404
+
401
405
<button>
402
406
Reset value
403
407
</button>
404
- "Found multiple elements with the role "button" and name \`/value/i\`
405
408
406
409
(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).
407
410
@@ -431,6 +434,20 @@ test('accessible string name in error message for multiple found', () => {
431
434
. toThrowErrorMatchingInlineSnapshot ( `
432
435
"Found multiple elements with the role "button" and name "Submit"
433
436
437
+ Here are the matching elements:
438
+
439
+ <button>
440
+ Submit
441
+ </button>
442
+
443
+ <button>
444
+ Submit
445
+ </button>
446
+
447
+ <button>
448
+ Submit
449
+ </button>
450
+
434
451
(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).
435
452
436
453
<div>
@@ -458,7 +475,7 @@ test('matching elements in error for multiple found', () => {
458
475
459
476
expect ( ( ) => getByRole ( 'button' , { name : / v a l u e / i} ) )
460
477
. toThrowErrorMatchingInlineSnapshot ( `
461
- "Found multiple elements with the role "button"
478
+ "Found multiple elements with the role "button" and name \`/value/i\`
462
479
463
480
Here are the matching elements:
464
481
0 commit comments