@@ -264,9 +264,10 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
264264 await expect ( page . locator ( "[data-game-list]" ) ) . toContainText ( "Gravity Demo" ) ;
265265 await expect ( page . locator ( "[data-game-list]" ) ) . toContainText ( "Collision Demo" ) ;
266266 await expect ( page . locator ( "[data-game-list]" ) ) . toContainText ( "Camera Follow Demo" ) ;
267- await expect ( page . locator ( "[data-game-parent-table='open-games']" ) ) . toHaveAttribute ( "aria-label" , "Open Games" ) ;
268- await expect ( page . locator ( "[data-game-parent-table='open-games'] caption" ) ) . toHaveText ( "Open Games" ) ;
269- await expect ( page . locator ( "[data-game-parent-table='open-games'] thead th" ) ) . toHaveText ( [
267+ await expect ( page . locator ( "[data-game-parent-table='open-games']" ) ) . toHaveCount ( 0 ) ;
268+ await expect ( page . locator ( "[data-game-rows-table='true']" ) ) . toHaveAttribute ( "aria-label" , "Games" ) ;
269+ await expect ( page . locator ( "[data-game-rows-table='true'] caption" ) ) . toHaveCount ( 0 ) ;
270+ await expect ( page . locator ( "[data-game-rows-table='true'] thead th" ) ) . toHaveText ( [
270271 "Game" ,
271272 "Purpose" ,
272273 "Status" ,
@@ -280,17 +281,14 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
280281 await expect ( demoGameRow . getByRole ( "button" , { name : "Open Demo Game (Active)" } ) ) . toHaveAttribute ( "aria-current" , "true" ) ;
281282 await demoGameRow . locator ( "[data-game-toggle='demo-game']" ) . click ( ) ;
282283 await expect ( demoGameRow . locator ( "[data-game-toggle='demo-game']" ) ) . toHaveAttribute ( "aria-expanded" , "true" ) ;
283- await expect ( page . locator ( "[data-game-row='demo-game'] + [data-game-expanded-row='demo-game']" ) ) . toHaveCount ( 1 ) ;
284- await expect ( page . locator ( "[data-game-expanded-row='demo-game'] [data-game-child-table='summary']" ) ) . toContainText ( "Game Summary" ) ;
285- await expect ( page . locator ( "[data-game-expanded-row='demo-game'] [data-game-child-table='summary'] tbody tr" ) ) . toHaveText ( [
286- "ProjectDemo Game" ,
287- "PurposeGame" ,
288- "StatusUnder Construction" ,
289- "OwnerUser 1" ,
290- ] ) ;
291- await expect ( page . locator ( "[data-game-expanded-row='demo-game'] [data-game-child-table]" ) ) . toHaveCount ( 3 ) ;
292- await expect ( page . locator ( "[data-game-expanded-row='demo-game'] [data-game-child-table='source-idea'] caption" ) ) . toHaveText ( "Source Idea" ) ;
293- const readinessOutputTable = page . locator ( "[data-game-expanded-row='demo-game'] [data-game-child-table='readiness-output']" ) ;
284+ const demoChildRows = page . locator ( "[data-game-expanded-row='demo-game']" ) ;
285+ await expect ( demoChildRows ) . toHaveCount ( 2 ) ;
286+ await expect ( demoChildRows . nth ( 0 ) ) . toHaveAttribute ( "data-game-child-row" , "source-idea" ) ;
287+ await expect ( demoChildRows . nth ( 1 ) ) . toHaveAttribute ( "data-game-child-row" , "readiness-output" ) ;
288+ await expect ( page . locator ( "[data-game-expanded-row='demo-game'] [data-game-child-table='summary']" ) ) . toHaveCount ( 0 ) ;
289+ await expect ( page . locator ( "[data-game-expanded-row='demo-game'] [data-game-child-table]" ) ) . toHaveCount ( 2 ) ;
290+ await expect ( demoChildRows . nth ( 0 ) . locator ( "[data-game-child-table='source-idea'] caption" ) ) . toHaveText ( "Source Idea" ) ;
291+ const readinessOutputTable = demoChildRows . nth ( 1 ) . locator ( "[data-game-child-table='readiness-output']" ) ;
294292 await expect ( readinessOutputTable . locator ( "caption" ) ) . toHaveText ( "Readiness Output" ) ;
295293 await expect ( readinessOutputTable . locator ( "thead th" ) ) . toHaveText ( [ "Output" , "Status" ] ) ;
296294 await expect ( readinessOutputTable . locator ( "tbody tr" ) ) . toHaveText ( [
@@ -335,7 +333,7 @@ test("Game Hub creates, opens, and deletes mock games", async ({ page }) => {
335333 }
336334} ) ;
337335
338- test ( "Game Hub validates Open Games parent and child tables" , async ( { page } ) => {
336+ test ( "Game Hub validates game parent rows and child tables" , async ( { page } ) => {
339337 const sourceLinkedGame = {
340338 id : "lantern-reef" ,
341339 ownerKey : MOCK_DB_KEYS . users . user1 ,
@@ -422,20 +420,25 @@ test("Game Hub validates Open Games parent and child tables", async ({ page }) =
422420 const failures = await openRepoPage ( page , "/toolbox/game-hub/index.html" , { session : creatorSession ( ) } ) ;
423421
424422 try {
425- await expect ( page . locator ( "[data-game-parent-table='open-games'] caption" ) ) . toHaveText ( "Open Games" ) ;
426- const parentRows = page . locator ( "[data-game-parent-table='open-games'] tbody > [data-game-row]" ) ;
423+ await expect ( page . locator ( "[data-game-parent-table='open-games']" ) ) . toHaveCount ( 0 ) ;
424+ await expect ( page . locator ( "[data-game-rows-table='true']" ) ) . toHaveAttribute ( "aria-label" , "Games" ) ;
425+ await expect ( page . locator ( "[data-game-rows-table='true'] caption" ) ) . toHaveCount ( 0 ) ;
426+ const parentRows = page . locator ( "[data-game-rows-table='true'] tbody > [data-game-row]" ) ;
427427 await expect ( parentRows ) . toHaveCount ( 1 ) ;
428428 const gameRow = page . locator ( "[data-game-row='lantern-reef']" ) ;
429429 await expect ( gameRow ) . toContainText ( "Lantern Reef" ) ;
430430 await expect ( gameRow . locator ( "[data-game-toggle='lantern-reef']" ) ) . toHaveAttribute ( "aria-expanded" , "false" ) ;
431431
432432 await gameRow . locator ( "[data-game-toggle='lantern-reef']" ) . click ( ) ;
433433 await expect ( gameRow . locator ( "[data-game-toggle='lantern-reef']" ) ) . toHaveAttribute ( "aria-expanded" , "true" ) ;
434- const expandedRow = page . locator ( "[data-game-expanded-row='lantern-reef']" ) ;
435- await expect ( expandedRow ) . toHaveCount ( 1 ) ;
436- await expect ( expandedRow . locator ( "[data-game-child-table]" ) ) . toHaveCount ( 3 ) ;
437-
438- const sourceIdeaTable = expandedRow . locator ( "[data-game-child-table='source-idea']" ) ;
434+ const expandedRows = page . locator ( "[data-game-expanded-row='lantern-reef']" ) ;
435+ await expect ( expandedRows ) . toHaveCount ( 2 ) ;
436+ await expect ( expandedRows . nth ( 0 ) ) . toHaveAttribute ( "data-game-child-row" , "source-idea" ) ;
437+ await expect ( expandedRows . nth ( 1 ) ) . toHaveAttribute ( "data-game-child-row" , "readiness-output" ) ;
438+ await expect ( expandedRows . locator ( "[data-game-child-table]" ) ) . toHaveCount ( 2 ) ;
439+ await expect ( expandedRows . locator ( "[data-game-child-table='summary']" ) ) . toHaveCount ( 0 ) ;
440+
441+ const sourceIdeaTable = expandedRows . nth ( 0 ) . locator ( "[data-game-child-table='source-idea']" ) ;
439442 await expect ( sourceIdeaTable . locator ( "caption" ) ) . toHaveText ( "Source Idea" ) ;
440443 await expect ( sourceIdeaTable . locator ( "tbody tr" ) ) . toHaveText ( [
441444 "IdeaLantern Reef" ,
@@ -446,7 +449,7 @@ test("Game Hub validates Open Games parent and child tables", async ({ page }) =
446449 await expect ( sourceIdeaTable . locator ( "button, input, textarea, select, [contenteditable='true'], [role='button']" ) ) . toHaveCount ( 0 ) ;
447450 await expect ( sourceIdeaTable ) . not . toContainText ( / E d i t | D e l e t e | C u r r e n t F o c u s | R e c o m m e n d e d N e x t T o o l / ) ;
448451
449- const readinessOutputTable = expandedRow . locator ( "[data-game-child-table='readiness-output']" ) ;
452+ const readinessOutputTable = expandedRows . nth ( 1 ) . locator ( "[data-game-child-table='readiness-output']" ) ;
450453 await expect ( readinessOutputTable . locator ( "caption" ) ) . toHaveText ( "Readiness Output" ) ;
451454 await expect ( readinessOutputTable . locator ( "thead th" ) ) . toHaveText ( [ "Output" , "Status" ] ) ;
452455 await expect ( readinessOutputTable ) . not . toContainText ( / G u i d e r e e f k e e p e r s | K e e p t r a v e r s a l g e n t l e | U s e w a r m l a n t e r n a r t / ) ;
0 commit comments