Refine PitchFast campaign visual identity
This commit is contained in:
42
tests/dashboard-sidebar-branding.test.ts
Normal file
42
tests/dashboard-sidebar-branding.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
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");
|
||||
|
||||
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("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"/);
|
||||
});
|
||||
Reference in New Issue
Block a user