File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,20 @@ test.describe('lib/fixture.ts (locators)', () => {
253
253
expect ( text ) . toEqual ( [ 'Hello h1' , 'Hello h2' ] )
254
254
} )
255
255
256
+ test . describe ( 'accessible tables?' , ( ) => {
257
+ test . use ( { asyncUtilTimeout : 3000 } )
258
+
259
+ test . only ( 'matches table row with `RegExp` text matcher' , async ( { screen, within} ) => {
260
+ const table = await screen . findByTestId ( 'editable-nested-table-GroupCode' )
261
+ const row = within ( table ) . getByRole ( 'row' , { name : / L I N E H O L D E R / } )
262
+ const checkbox = within ( row ) . getByRole ( 'checkbox' )
263
+
264
+ await expect ( checkbox ) . not . toBeChecked ( )
265
+ await checkbox . check ( )
266
+ await expect ( checkbox ) . toBeChecked ( )
267
+ } )
268
+ } )
269
+
256
270
test ( 'throws Testing Library error when locator times out' , async ( { queries} ) => {
257
271
const query = async ( ) => queries . findByText ( / L o a d e d ! / , undefined , { timeout : 500 } )
258
272
Original file line number Diff line number Diff line change 3
3
< body >
4
4
< span > Loading...</ span >
5
5
< span id ="hidden " style ="visibility: hidden "> Hidden</ span >
6
+
7
+ < table data-testid ="editable-nested-table-GroupCode " class ="css-1n5gbw2 " style ="display: none; " id ="table ">
8
+ < tbody >
9
+ < tr data-testid ="erow-GroupCode-0 " class ="css-105800b ">
10
+ < td data-testid ="etd-GroupCode-active-0 " class ="css-1f7ypku ">
11
+ < label
12
+ for ="input-GroupCode-active-0 "
13
+ data-testid ="checkbox-input-GroupCode-active-0 "
14
+ class ="css-1lua7zz "
15
+ >
16
+ < input type ="checkbox " id ="input-GroupCode-active-0 " name ="input-GroupCode-active-0 " aria-labelledby ="input-GroupCode-active-0 " class ="css-38lalc ">
17
+ < span tabindex ="0 " class ="css-12234rr "> …</ span >
18
+ < span class ="css-1008avk "> </ span >
19
+ </ label >
20
+ </ td >
21
+ < td data-testid ="td-GroupCode-code-0 " class ="css-1f7voku "> 01</ td >
22
+ < td data-testid ="td-GroupCode-description-0 " class ="css-1f7vpku "> LINEHOLDER</ td >
23
+ </ tr >
24
+ </ tbody >
25
+ </ table >
26
+
6
27
< script >
7
28
setTimeout ( ( ) => {
8
29
const loaded = document . createElement ( 'span' )
44
65
modal . appendChild ( modalHeader )
45
66
46
67
document . body . appendChild ( modal )
68
+
69
+ // Deferred Table
70
+ document . querySelector ( '#table' ) . style = 'display: table'
47
71
} , 2000 )
48
72
</ script >
49
73
</ body >
You can’t perform that action at this time.
0 commit comments