feat: complete MVP foundation auth and dashboard
This commit is contained in:
51
tests/dashboard-model.test.ts
Normal file
51
tests/dashboard-model.test.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
dashboardKpis,
|
||||
dashboardNavigation,
|
||||
pipelineStages,
|
||||
reviewQueue,
|
||||
} from "../lib/dashboard-model";
|
||||
|
||||
type NavigationItem = { label: string; href: string };
|
||||
type PipelineStage = { title: string; count: number };
|
||||
type ReviewQueueItem = { title: string };
|
||||
|
||||
test("dashboardNavigation contains the expected sidebar routes in order", () => {
|
||||
assert.deepEqual(
|
||||
dashboardNavigation.map((item: NavigationItem) => [item.label, item.href]),
|
||||
[
|
||||
["Dashboard", "/dashboard"],
|
||||
["Campaigns", "/dashboard/campaigns"],
|
||||
["Leads", "/dashboard/leads"],
|
||||
["Audits", "/dashboard/audits"],
|
||||
["Outreach", "/dashboard/outreach"],
|
||||
["Analytics", "/dashboard/analytics"],
|
||||
["Blacklist", "/dashboard/blacklist"],
|
||||
["Settings", "/dashboard/settings"],
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
test("pipelineStages keep the first-screen workflow focused on pipeline overview", () => {
|
||||
assert.deepEqual(
|
||||
pipelineStages.map((stage: PipelineStage) => stage.title),
|
||||
["Kampagnen", "Lead-Recherche", "Audit-Freigabe", "Outreach"],
|
||||
);
|
||||
assert.equal(
|
||||
pipelineStages.every((stage: PipelineStage) => stage.count >= 0),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test("dashboardKpis and reviewQueue expose the above-the-fold dashboard summary", () => {
|
||||
assert.equal(dashboardKpis.length, 4);
|
||||
assert.equal(reviewQueue.length, 3);
|
||||
assert.equal(
|
||||
reviewQueue.some((item: ReviewQueueItem) =>
|
||||
item.title.includes("Audit-Freigabe"),
|
||||
),
|
||||
true,
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user