ui: plan 01-27 done #1
@@ -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<unknown>;
|
||||
setDeviceSessionId(id: string): Promise<void>;
|
||||
}
|
||||
|
||||
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<void> {
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user