This repository was archived by the owner on Aug 6, 2025. It is now read-only.
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)', () => {
253253 expect ( text ) . toEqual ( [ 'Hello h1' , 'Hello h2' ] )
254254 } )
255255
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+
256270 test ( 'throws Testing Library error when locator times out' , async ( { queries} ) => {
257271 const query = async ( ) => queries . findByText ( / L o a d e d ! / , undefined , { timeout : 500 } )
258272
Original file line number Diff line number Diff line change 33 < body >
44 < span > Loading...</ span >
55 < 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+
627 < script >
728 setTimeout ( ( ) => {
829 const loaded = document . createElement ( 'span' )
4465 modal . appendChild ( modalHeader )
4566
4667 document . body . appendChild ( modal )
68+
69+ // Deferred Table
70+ document . querySelector ( '#table' ) . style = 'display: table'
4771 } , 2000 )
4872 </ script >
4973 </ body >
You can’t perform that action at this time.
0 commit comments