File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,27 @@ export const createSortableTests = () => {
383
383
expect ( firstCell ) . toBe ( 'J' )
384
384
} )
385
385
386
+ defineTest ( 'ensures allTables[8] has a TR with no TD' , async ( { page } ) => {
387
+ const allTables = await page . $$ ( 'table.sortable' )
388
+ const table = allTables [ 8 ]
389
+ const nameHeader = await table . $ ( 'th[aria-label*="Letters"]' )
390
+
391
+ // Sort empty TR to the bottom of table.
392
+ await nameHeader ?. click ( )
393
+ await waitForSort ( page )
394
+
395
+ // Sort empty TR to top of table.
396
+ await nameHeader ?. click ( )
397
+ await waitForSort ( page )
398
+
399
+ try {
400
+ firstCell = await table . $eval ( 'tbody tr:first-child td:nth-child(1)' , ( el ) => el . textContent )
401
+ test . fail ( "Expected 'td:nth-child(1)' to not exist, but it does exist" )
402
+ } catch ( err ) {
403
+ expect ( err . message ) . toEqual ( 'elementHandle.$eval: Failed to find element matching selector "tbody tr:first-child td:nth-child(1)"' )
404
+ }
405
+ } )
406
+
386
407
defineTest ( 'sorts a table with missing TD elements' , async ( { page } ) => {
387
408
const allTables = await page . $$ ( 'table.sortable' )
388
409
const table = allTables [ 8 ]
You can’t perform that action at this time.
0 commit comments