55 lines
2.0 KiB
TypeScript
55 lines
2.0 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
import { join } from "node:path";
|
|
import test from "node:test";
|
|
|
|
const sidebarPath = join(
|
|
process.cwd(),
|
|
"components",
|
|
"dashboard-sidebar.tsx",
|
|
);
|
|
const authEntryPath = join(process.cwd(), "components", "auth-entry.tsx");
|
|
const layoutPath = join(process.cwd(), "app", "layout.tsx");
|
|
const globalsPath = join(process.cwd(), "app", "globals.css");
|
|
const themePath = join(process.cwd(), "components", "dashboard-theme.tsx");
|
|
|
|
test("dashboard sidebar uses PitchFast SaaS branding", async () => {
|
|
const source = await readFile(sidebarPath, "utf8");
|
|
|
|
assert.match(source, />\s*PF\s*</);
|
|
assert.match(source, />\s*PitchFast\s*</);
|
|
assert.match(source, />\s*Agency Evidence Desk\s*</);
|
|
assert.doesNotMatch(source, />\s*WebDev Pipeline\s*</);
|
|
});
|
|
|
|
test("light theme sidebar remains a light operational rail", async () => {
|
|
const styles = await readFile(globalsPath, "utf8");
|
|
const rootBlock = styles.match(/:root\s*{([\s\S]*?)\n}/)?.[1] ?? "";
|
|
const darkBlock = styles.match(/\.dark\s*{([\s\S]*?)\n}/)?.[1] ?? "";
|
|
|
|
assert.match(rootBlock, /--sidebar:\s*oklch\(0\.94/);
|
|
assert.match(rootBlock, /--sidebar-foreground:\s*oklch\(0\.19/);
|
|
assert.match(darkBlock, /--sidebar:\s*oklch\(0\.13/);
|
|
});
|
|
|
|
test("desktop dashboard shell keeps sidebar height independent from content", async () => {
|
|
const sidebar = await readFile(sidebarPath, "utf8");
|
|
const theme = await readFile(themePath, "utf8");
|
|
|
|
assert.match(theme, /md:items-start/);
|
|
assert.match(sidebar, /md:h-dvh/);
|
|
assert.match(sidebar, /md:self-start/);
|
|
assert.match(sidebar, /md:overflow-y-auto/);
|
|
assert.doesNotMatch(sidebar, /md:min-h-dvh/);
|
|
});
|
|
|
|
test("public entry branding also uses PitchFast", async () => {
|
|
const authEntry = await readFile(authEntryPath, "utf8");
|
|
const layout = await readFile(layoutPath, "utf8");
|
|
|
|
assert.match(authEntry, />\s*PF\s*</);
|
|
assert.match(authEntry, />\s*PitchFast\s*</);
|
|
assert.doesNotMatch(authEntry, />\s*WebDev Pipeline\s*</);
|
|
assert.match(layout, /title:\s*"PitchFast"/);
|
|
});
|