diff --git a/ui/frontend/tests/e2e/inspector-ship-group.spec.ts b/ui/frontend/tests/e2e/inspector-ship-group.spec.ts index b1b537d..f655fcf 100644 --- a/ui/frontend/tests/e2e/inspector-ship-group.spec.ts +++ b/ui/frontend/tests/e2e/inspector-ship-group.spec.ts @@ -8,7 +8,35 @@ // glue: lobby loader → in-memory registry → layout bypass → renderer // boot. -import { expect, test } from "@playwright/test"; +import { expect, test, type Page } from "@playwright/test"; + +interface DebugSurface { + ready: true; + loadSession(): Promise; + setDeviceSessionId(id: string): Promise; +} + +declare global { + interface Window { + __galaxyDebug?: DebugSurface; + } +} + +// Seed an authenticated session through `/__debug/store` so the +// root layout's redirect-to-login guard passes. The synthetic flow +// itself does not talk to the gateway, but the session check still +// runs at every navigation. +async function seedSession(page: Page): Promise { + await page.goto("/__debug/store"); + await expect(page.getByTestId("debug-store-ready")).toBeVisible(); + await page.waitForFunction(() => window.__galaxyDebug?.ready === true); + await page.evaluate(async () => { + await window.__galaxyDebug!.loadSession(); + await window.__galaxyDebug!.setDeviceSessionId( + "phase-19-synthetic-session", + ); + }); +} const SYNTHETIC_REPORT_FIXTURE = { turn: 39, @@ -111,6 +139,7 @@ const SYNTHETIC_REPORT_FIXTURE = { test("synthetic-report loader navigates from lobby to map and renders", async ({ page, }) => { + await seedSession(page); await page.goto("/lobby"); await expect(page.getByTestId("lobby-synthetic-section")).toBeVisible();