@@ -43,6 +43,34 @@ test.describe("Workspace Manager V2 bootstrap", () => {
4343 await expect ( card . locator ( "a" , { hasText : "Workspace Manager V2" } ) ) . toHaveAttribute ( "href" , "/tools/workspace-manager-v2/index.html" ) ;
4444 await expect ( card ) . toContainText ( "First-Class Tool V2 workspace surface" ) ;
4545 await expect ( card ) . toContainText ( "Workspace" ) ;
46+ const toolsIndexState = await page . evaluate ( ( ) => {
47+ const firstClassToolsSection = Array . from ( document . querySelectorAll ( "section" ) )
48+ . find ( ( section ) => section . querySelector ( ":scope > h2" ) ?. textContent ?. trim ( ) === "First-Class Tools" ) ;
49+ const workflowGrid = firstClassToolsSection ?. querySelector ( "[data-active-tools-workflow-grid]" ) ;
50+ const utilitiesGrid = firstClassToolsSection ?. querySelector ( "[data-active-tools-utilities-grid]" ) ;
51+ const workspaceCard = workflowGrid ?. querySelector ( ".tools-platform-card" ) ;
52+ return {
53+ actionLabels : Array . from ( firstClassToolsSection ?. querySelectorAll ( ".tools-platform-card__action" ) || [ ] )
54+ . map ( ( action ) => action . textContent . trim ( ) ) ,
55+ headings : Array . from ( firstClassToolsSection ?. querySelectorAll ( ":scope > h3" ) || [ ] )
56+ . map ( ( heading ) => heading . textContent . trim ( ) ) ,
57+ sampleLabels : Array . from ( firstClassToolsSection ?. querySelectorAll ( ".tools-platform-card__action" ) || [ ] )
58+ . map ( ( action ) => action . textContent . trim ( ) )
59+ . filter ( ( label ) => label . startsWith ( "Samples" ) ) ,
60+ utilitiesCards : Array . from ( utilitiesGrid ?. querySelectorAll ( ".tools-platform-card h3" ) || [ ] )
61+ . map ( ( heading ) => heading . textContent . trim ( ) ) ,
62+ workflowCards : Array . from ( workflowGrid ?. querySelectorAll ( ".tools-platform-card h3" ) || [ ] )
63+ . map ( ( heading ) => heading . textContent . trim ( ) ) ,
64+ workspaceActionLabels : Array . from ( workspaceCard ?. querySelectorAll ( ".tools-platform-card__action" ) || [ ] )
65+ . map ( ( action ) => action . textContent . trim ( ) )
66+ } ;
67+ } ) ;
68+ expect ( toolsIndexState . headings . slice ( 0 , 4 ) ) . toEqual ( [ "Workflow" , "Editors" , "Utilities" , "Viewers" ] ) ;
69+ expect ( toolsIndexState . workflowCards ) . toEqual ( [ "Workspace Manager V2" ] ) ;
70+ expect ( toolsIndexState . utilitiesCards ) . not . toContain ( "Workspace Manager V2" ) ;
71+ expect ( toolsIndexState . workspaceActionLabels ) . toEqual ( [ "How To Use" , "Read Me" ] ) ;
72+ expect ( toolsIndexState . actionLabels ) . not . toContain ( "README" ) ;
73+ expect ( toolsIndexState . sampleLabels . every ( ( label ) => / ^ S a m p l e s \( \d + \) $ / . test ( label ) ) ) . toBe ( true ) ;
4674 expect ( pageErrors ) . toEqual ( [ ] ) ;
4775 } finally {
4876 await coverageReporter . stop ( page ) ;
@@ -140,6 +168,11 @@ test.describe("Workspace Manager V2 bootstrap", () => {
140168 await expect ( page . locator ( "#seedUatManifestButton" ) ) . toBeHidden ( ) ;
141169 await expect ( page . locator ( "#loadAsteroidsButton" ) ) . toHaveText ( "Load Asteroids" ) ;
142170 await expect ( page . locator ( "#launchAssetManagerV2Button" ) ) . toHaveCount ( 0 ) ;
171+ await expect ( page . locator ( "#workspaceToolsContent #workspaceToolTiles" ) ) . toBeVisible ( ) ;
172+ await expect ( page . locator ( "#workspaceContextContent #workspaceToolTiles" ) ) . toHaveCount ( 0 ) ;
173+ const centerControlLabels = await page . locator ( ".workspace-manager-v2__panel--center > .accordion-v2 > .accordion-v2__header span:first-child" )
174+ . evaluateAll ( ( labels ) => labels . map ( ( label ) => label . textContent . trim ( ) ) ) ;
175+ expect ( centerControlLabels . slice ( 0 , 2 ) ) . toEqual ( [ "Tools" , "Workspace Context" ] ) ;
143176 await expect ( page . locator ( "#workspaceToolTiles [data-workspace-tool-id]" ) ) . toHaveCount ( 5 ) ;
144177 expect ( await page . locator ( "#workspaceToolTiles [data-workspace-tool-id]" ) . evaluateAll ( ( tiles ) => tiles . every ( ( tile ) => tile . disabled ) ) ) . toBe ( true ) ;
145178 await expect ( page . locator ( "#activeGameSelect option" ) ) . toHaveText ( [
@@ -155,6 +188,9 @@ test.describe("Workspace Manager V2 bootstrap", () => {
155188 await expect ( page . locator ( "#activePaletteSummary" ) ) . toContainText ( "active colors" ) ;
156189 await expect ( page . locator ( "#activeAssetRegistrySummary" ) ) . toHaveText ( "Schema-ready Asset Manager V2 manifest payload contains 13 managed assets." ) ;
157190 await expect ( page . locator ( "#launchContextSummary" ) ) . toHaveText ( "Schema-valid manifest is ready for Asteroids." ) ;
191+ const workspaceContextTileHeights = await page . locator ( ".workspace-manager-v2__summary-card" ) . evaluateAll ( ( tiles ) => tiles . map ( ( tile ) => Math . round ( tile . getBoundingClientRect ( ) . height ) ) ) ;
192+ expect ( new Set ( workspaceContextTileHeights ) . size ) . toBe ( 1 ) ;
193+ expect ( workspaceContextTileHeights . every ( ( height ) => height >= 118 ) ) . toBe ( true ) ;
158194 await expect ( page . locator ( "#workspaceContextOutput" ) ) . toContainText ( '"gameRoot": "games/Asteroids/"' ) ;
159195 await expect ( page . locator ( "#workspaceContextOutput" ) ) . toContainText ( '"assetsPath": "games/Asteroids/assets"' ) ;
160196 await expect ( page . locator ( "#workspaceContextOutput" ) ) . toContainText ( '"source": "manifest"' ) ;
0 commit comments