test(ui): migrate suite to the app-shell (state-driven navigation)
- Unit: repoint moved screen imports (lib/screens, lib/game), mock $lib/app-nav (appScreen/activeView) instead of $app/navigation, drop the removed gameId props, assert screen/view selection. - e2e: add a dev-only window.__galaxyNav affordance; specs enter a game via enterGame(...) instead of a /games/:id URL; URL assertions become content assertions (the URL stays /game/); reload uses waitUntil:"commit" (shallow routing) and mocks /rpc on game entry. - Remove the obsolete report scroll-restore test (it relied on a SvelteKit route Snapshot that no longer exists); update the missing-membership test to the new lobby-redirect+toast behaviour. Fix a stale report.svelte docstring. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,12 +3,15 @@
|
||||
// registration, offline-from-cache load, and the version-keyed cache
|
||||
// (a new deploy's `version` makes a new cache and `activate` drops the
|
||||
// old one — verified here as "exactly one galaxy cache, version-keyed").
|
||||
// The single-URL app-shell boots at the app base (`/`); with no seeded
|
||||
// session the dispatcher renders the login screen, so the shell's
|
||||
// `#main-content` region is the boot signal here.
|
||||
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("PWA", () => {
|
||||
test("links a web manifest with installable icons", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
await page.goto("/");
|
||||
const href = await page
|
||||
.locator('head link[rel="manifest"]')
|
||||
.getAttribute("href");
|
||||
@@ -33,7 +36,7 @@ test.describe("PWA", () => {
|
||||
});
|
||||
|
||||
test("registers a service worker that controls the page", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
await page.goto("/");
|
||||
await page.waitForFunction(
|
||||
() => navigator.serviceWorker.controller !== null,
|
||||
null,
|
||||
@@ -50,7 +53,7 @@ test.describe("PWA", () => {
|
||||
page,
|
||||
context,
|
||||
}) => {
|
||||
await page.goto("/login");
|
||||
await page.goto("/");
|
||||
await page.waitForFunction(
|
||||
() => navigator.serviceWorker.controller !== null,
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user