Files
siftlode/frontend/e2e/nav.spec.ts
T
peter e257e2aca0 style(frontend): Prettier config + one-time repo-wide format pass
Prettier 3 (pinned), printWidth 100, double quotes — chosen to match the existing
hand-formatting and minimise reflow. This commit is ONLY the mechanical format pass
(`prettier --write`) plus the config/ignore/scripts, isolated so it never pollutes a
feature diff. Verified behaviour-neutral: typecheck, eslint (0 errors), and vitest
all green before and after. See .git-blame-ignore-revs — `git blame` skips this sha.
2026-07-21 02:26:40 +02:00

43 lines
1.5 KiB
TypeScript

import { test, expect } from "@playwright/test";
import { openApp } from "./helpers";
// Locks top-level navigation: each rail item activates its page (aria-current), and browser
// Back steps through the history the app pushes. The render ternary + prop-drilled page state
// this exercises is precisely what the module-registry refactor replaces.
test.describe("page switching", () => {
// Core + admin modules (the E2E account is an admin, matching the real primary user), so this
// also exercises the render ternary's admin branches (scheduler / config / users / audit).
const RAIL = [
"channels",
"playlists",
"stats",
"scheduler",
"config",
"users",
"audit",
"settings",
"feed",
];
test("each rail item activates its page", async ({ page }) => {
await openApp(page);
for (const id of RAIL) {
await page.getByTestId(`nav-${id}`).click();
await expect(page.getByTestId(`nav-${id}`)).toHaveAttribute("aria-current", "page");
}
});
test("browser Back steps through visited pages", async ({ page }) => {
await openApp(page);
await page.getByTestId("nav-channels").click();
await expect(page.getByTestId("nav-channels")).toHaveAttribute("aria-current", "page");
await page.getByTestId("nav-playlists").click();
await expect(page.getByTestId("nav-playlists")).toHaveAttribute("aria-current", "page");
await page.goBack();
await expect(page.getByTestId("nav-channels")).toHaveAttribute("aria-current", "page");
});
});