- The raw-source contract tests read files from disk (rawSources.testkit) instead of import.meta.glob, which knip counted as importing every src file — its unused-files lane could never name an orphan. knip now names src/watchMain.tsx as an entry (registered in docs/gates.md). - vite build fails when index.html or watch.html is not emitted. - The watch-entry import walk follows dynamic import() too. - audit_metrics.py's plan-code patterns are held equal to the guard's. - CrashBoundary is domain-free: it moves into components/ui.
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { readSources } from "../../lib/rawSources.testkit";
|
|
|
|
// docs/DESIGN.md "Background menu": which pages have one is the owner's call (2026-09-26, scope A) —
|
|
// the list pages whose toolbar sorts, filters or switches a view: the feed, the Plex library, the
|
|
// channel manager, a playlist and the notification center. The tab-only pages (settings, config,
|
|
// stats, users, downloads) keep the browser's menu. A page that starts rendering one fails here until
|
|
// that decision is taken again.
|
|
const files = readSources(__dirname, [
|
|
"../**/*.tsx",
|
|
"!../**/*.test.*",
|
|
"!../design-lab/**",
|
|
"!./**",
|
|
]) as Record<string, string>;
|
|
|
|
describe("the pages with a background menu", () => {
|
|
it("are the five the owner chose", () => {
|
|
const users = Object.entries(files)
|
|
.filter(([, code]) => /<PageMenu\b|\busePageMenu\(/.test(code))
|
|
.map(([path]) => path.replace(/^\.\.\//, ""))
|
|
.sort();
|
|
expect(users).toEqual([
|
|
"Channels.tsx",
|
|
"Feed.tsx",
|
|
"NotificationsPanel.tsx",
|
|
"Playlists.tsx",
|
|
"PlexBrowse.tsx",
|
|
]);
|
|
});
|
|
});
|