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, non-admin modules that always exist for the E2E account. const RAIL = ["channels", "playlists", "stats", "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"); }); });