Skip to content

Commit 0c1aa00

Browse files
committed
Update snapshots
1 parent ca059fc commit 0c1aa00

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

src/__tests__/element-queries.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ test('get throws a useful error message', () => {
3737
.toThrowErrorMatchingInlineSnapshot(`
3838
"Unable to find a label with the text of: LucyRicardo
3939
40+
Ignored nodes: comments, <script />, <style />
4041
<div>
4142
<div />
4243
</div>"
@@ -45,34 +46,39 @@ test('get throws a useful error message', () => {
4546
.toThrowErrorMatchingInlineSnapshot(`
4647
"Unable to find an element with the placeholder text of: LucyRicardo
4748
49+
Ignored nodes: comments, <script />, <style />
4850
<div>
4951
<div />
5052
</div>"
5153
`)
5254
expect(() => getByText('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
5355
"Unable to find an element with the text: LucyRicardo. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
5456
57+
Ignored nodes: comments, <script />, <style />
5558
<div>
5659
<div />
5760
</div>"
5861
`)
5962
expect(() => getByTestId('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
6063
"Unable to find an element by: [data-testid="LucyRicardo"]
6164
65+
Ignored nodes: comments, <script />, <style />
6266
<div>
6367
<div />
6468
</div>"
6569
`)
6670
expect(() => getByAltText('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
6771
"Unable to find an element with the alt text: LucyRicardo
6872
73+
Ignored nodes: comments, <script />, <style />
6974
<div>
7075
<div />
7176
</div>"
7277
`)
7378
expect(() => getByTitle('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
7479
"Unable to find an element with the title: LucyRicardo.
7580
81+
Ignored nodes: comments, <script />, <style />
7682
<div>
7783
<div />
7884
</div>"
@@ -81,6 +87,7 @@ test('get throws a useful error message', () => {
8187
.toThrowErrorMatchingInlineSnapshot(`
8288
"Unable to find an element with the display value: LucyRicardo.
8389
90+
Ignored nodes: comments, <script />, <style />
8491
<div>
8592
<div />
8693
</div>"
@@ -90,6 +97,7 @@ test('get throws a useful error message', () => {
9097
9198
There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the \`hidden\` option to \`true\`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole
9299
100+
Ignored nodes: comments, <script />, <style />
93101
<div>
94102
<div />
95103
</div>"
@@ -354,6 +362,7 @@ test('label with no form control', () => {
354362
expect(() => getByLabelText(/alone/)).toThrowErrorMatchingInlineSnapshot(`
355363
"Found a label with the text of: /alone/, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.
356364
365+
Ignored nodes: comments, <script />, <style />
357366
<div>
358367
<label>
359368
All alone
@@ -371,6 +380,7 @@ test('label with "for" attribute but no form control and fuzzy matcher', () => {
371380
.toThrowErrorMatchingInlineSnapshot(`
372381
"Found a label with the text of: alone, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.
373382
383+
Ignored nodes: comments, <script />, <style />
374384
<div>
375385
<label
376386
for="foo"
@@ -393,6 +403,7 @@ test('label with children with no form control', () => {
393403
.toThrowErrorMatchingInlineSnapshot(`
394404
"Found a label with the text of: /alone/, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.
395405
406+
Ignored nodes: comments, <script />, <style />
396407
<div>
397408
398409
@@ -433,6 +444,7 @@ test('label with non-labellable element', () => {
433444
expect(() => getByLabelText(/Label/)).toThrowErrorMatchingInlineSnapshot(`
434445
"Found a label with the text of: /Label/, however the element associated with this label (<div />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <div />, you can use aria-label or aria-labelledby instead.
435446
447+
Ignored nodes: comments, <script />, <style />
436448
<div>
437449
438450
@@ -482,6 +494,7 @@ test('multiple labels with non-labellable elements', () => {
482494
483495
Found a label with the text of: /Label/, however the element associated with this label (<p />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <p />, you can use aria-label or aria-labelledby instead.
484496
497+
Ignored nodes: comments, <script />, <style />
485498
<div>
486499
487500
@@ -533,6 +546,7 @@ test('totally empty label', () => {
533546
expect(() => getByLabelText('')).toThrowErrorMatchingInlineSnapshot(`
534547
"Found a label with the text of: , however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.
535548
549+
Ignored nodes: comments, <script />, <style />
536550
<div>
537551
<label />
538552
</div>"
@@ -1221,6 +1235,7 @@ test('return a proper error message when no label is found and there is an aria-
12211235
.toThrowErrorMatchingInlineSnapshot(`
12221236
"Unable to find a label with the text of: LucyRicardo
12231237
1238+
Ignored nodes: comments, <script />, <style />
12241239
<div>
12251240
<input
12261241
aria-labelledby="not-existing-label"

src/__tests__/role.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Here are the accessible roles:
1616
1717
--------------------------------------------------
1818
19+
Ignored nodes: comments, <script />, <style />
1920
<div>
2021
<h1>
2122
Hi
@@ -39,6 +40,7 @@ Here are the available roles:
3940
4041
--------------------------------------------------
4142
43+
Ignored nodes: comments, <script />, <style />
4244
<div>
4345
<div
4446
hidden=""
@@ -58,6 +60,7 @@ test('logs error when there are no accessible roles', () => {
5860
5961
There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the \`hidden\` option to \`true\`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole
6062
63+
Ignored nodes: comments, <script />, <style />
6164
<div>
6265
<div />
6366
</div>"
@@ -72,6 +75,7 @@ test('logs a different error if inaccessible roles should be included', () => {
7275
7376
There are no available roles.
7477
78+
Ignored nodes: comments, <script />, <style />
7579
<div>
7680
<div />
7781
</div>"
@@ -86,6 +90,7 @@ test('by default excludes elements that have the html hidden attribute or any of
8690
8791
There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the \`hidden\` option to \`true\`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole
8892
93+
Ignored nodes: comments, <script />, <style />
8994
<div>
9095
<div
9196
hidden=""
@@ -106,6 +111,7 @@ test('by default excludes elements which have display: none or any of their pare
106111
107112
There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the \`hidden\` option to \`true\`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole
108113
114+
Ignored nodes: comments, <script />, <style />
109115
<div>
110116
<div
111117
style="display: none;"
@@ -128,6 +134,7 @@ test('by default excludes elements which have visibility hidden', () => {
128134
129135
There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the \`hidden\` option to \`true\`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole
130136
137+
Ignored nodes: comments, <script />, <style />
131138
<div>
132139
<div>
133140
<ul
@@ -152,6 +159,7 @@ test('by default excludes elements which have aria-hidden="true" or any of their
152159
153160
There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the \`hidden\` option to \`true\`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole
154161
162+
Ignored nodes: comments, <script />, <style />
155163
<div>
156164
<div
157165
aria-hidden="true"
@@ -241,6 +249,7 @@ Here are the accessible roles:
241249
242250
--------------------------------------------------
243251
252+
Ignored nodes: comments, <script />, <style />
244253
<div>
245254
<h1>
246255
Sign
@@ -287,6 +296,7 @@ Here are the accessible roles:
287296
288297
--------------------------------------------------
289298
299+
Ignored nodes: comments, <script />, <style />
290300
<div>
291301
<h1>
292302
Sign
@@ -310,6 +320,7 @@ Here are the accessible roles:
310320
311321
--------------------------------------------------
312322
323+
Ignored nodes: comments, <script />, <style />
313324
<div>
314325
<h1>
315326
Sign
@@ -337,6 +348,7 @@ Here are the accessible roles:
337348
338349
--------------------------------------------------
339350
351+
Ignored nodes: comments, <script />, <style />
340352
<ul>
341353
<li />
342354
</ul>"
@@ -371,6 +383,7 @@ Here are the accessible roles:
371383
372384
--------------------------------------------------
373385
386+
Ignored nodes: comments, <script />, <style />
374387
<body>
375388
<button
376389
aria-label="my-tab"
@@ -394,20 +407,24 @@ test('accessible regex name in error message for multiple found', () => {
394407
395408
Here are the matching elements:
396409
410+
Ignored nodes: comments, <script />, <style />
397411
<button>
398412
Increment value
399413
</button>
400414
415+
Ignored nodes: comments, <script />, <style />
401416
<button>
402417
Decrement value
403418
</button>
404419
420+
Ignored nodes: comments, <script />, <style />
405421
<button>
406422
Reset value
407423
</button>
408424
409425
(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).
410426
427+
Ignored nodes: comments, <script />, <style />
411428
<div>
412429
<button>
413430
Increment value
@@ -436,20 +453,24 @@ test('accessible string name in error message for multiple found', () => {
436453
437454
Here are the matching elements:
438455
456+
Ignored nodes: comments, <script />, <style />
439457
<button>
440458
Submit
441459
</button>
442460
461+
Ignored nodes: comments, <script />, <style />
443462
<button>
444463
Submit
445464
</button>
446465
466+
Ignored nodes: comments, <script />, <style />
447467
<button>
448468
Submit
449469
</button>
450470
451471
(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).
452472
473+
Ignored nodes: comments, <script />, <style />
453474
<div>
454475
<button>
455476
Submit
@@ -479,16 +500,19 @@ test('matching elements in error for multiple found', () => {
479500
480501
Here are the matching elements:
481502
503+
Ignored nodes: comments, <script />, <style />
482504
<button>
483505
Increment value
484506
</button>
485507
508+
Ignored nodes: comments, <script />, <style />
486509
<button>
487510
Reset value
488511
</button>
489512
490513
(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).
491514
515+
Ignored nodes: comments, <script />, <style />
492516
<div>
493517
<button>
494518
Increment value

src/__tests__/suggestions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ test('should suggest getByRole when used with getBy', () => {
111111
getByRole('button', { name: /submit/i })
112112
113113
114+
Ignored nodes: comments, <script />, <style />
114115
<body>
115116
<button
116117
data-testid="foo"
@@ -132,6 +133,7 @@ test('should suggest getAllByRole when used with getAllByTestId', () => {
132133
getAllByRole('button', { name: /submit/i })
133134
134135
136+
Ignored nodes: comments, <script />, <style />
135137
<body>
136138
137139

src/__tests__/wait-for.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ test('timeout logs a pretty DOM', async () => {
123123
expect(error.message).toMatchInlineSnapshot(`
124124
"always throws
125125
126+
Ignored nodes: comments, <script />, <style />
126127
<html>
127128
<head />
128129
<body>
@@ -186,6 +187,7 @@ test('when a promise is returned, if that is not resolved within the timeout, th
186187
expect((await waitForError).message).toMatchInlineSnapshot(`
187188
"Timed out in waitFor.
188189
190+
Ignored nodes: comments, <script />, <style />
189191
<html>
190192
<head />
191193
<body />

0 commit comments

Comments
 (0)