import { describe, expect, it } from "vitest"; import { pageTitleKey } from "./pageMeta"; import type { Page } from "./urlState"; // pageTitleKey now derives from the ModuleDef registry (titleKey ?? labelKey). These are the exact // browser-tab title keys the old hand-written switch produced — pin every page so a future labelKey // rename (or a dropped titleKey) can't silently change a tab title. const EXPECTED: Record = { home: "home.title", feed: "header.account.feed", channels: "header.channelManager", playlists: "header.account.playlists", notifications: "inbox.navLabel", files: "files.navLabel", stats: "header.usageStats", plex: "plex.navLabel", scheduler: "header.scheduler", config: "header.configuration", users: "header.users", audit: "audit.title", logs: "adminLogs.title", settings: "settings.title", }; describe("pageTitleKey", () => { it("returns the exact title key for every page (registry-derived)", () => { for (const [page, key] of Object.entries(EXPECTED)) { expect(pageTitleKey(page as Page)).toBe(key); } }); });