Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a deterministic verification core: clinical-trial claims checked against ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI recomputed in code, oracle-tested), code-enforced exact-span grounding, and multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing at scale (unpdf + Docling), agentic workflows, Claude Science connector, compliance/audit, billing, public API, and more. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { describe, it, expect, afterEach, vi } from "vitest";
|
|
import { cleanup, render, screen } from "@testing-library/react";
|
|
|
|
vi.mock("next/navigation", () => ({ usePathname: () => "/" }));
|
|
|
|
import { NavBar } from "../../components/NavBar";
|
|
|
|
afterEach(cleanup);
|
|
|
|
describe("NavBar", () => {
|
|
it("renders the brand and all nav links", () => {
|
|
render(<NavBar />);
|
|
|
|
expect(screen.getByText("PaperTrail")).toBeInTheDocument();
|
|
for (const label of [
|
|
"Verify",
|
|
"Batch",
|
|
"Compare",
|
|
"Sources",
|
|
"Recent",
|
|
"Dashboard",
|
|
"Accuracy",
|
|
"API",
|
|
"About",
|
|
]) {
|
|
expect(screen.getByText(label)).toBeInTheDocument();
|
|
}
|
|
});
|
|
|
|
it("renders nav links as anchors with correct hrefs", () => {
|
|
render(<NavBar />);
|
|
expect(screen.getByRole("link", { name: "Verify" })).toHaveAttribute(
|
|
"href",
|
|
"/",
|
|
);
|
|
expect(screen.getByRole("link", { name: "Batch" })).toHaveAttribute(
|
|
"href",
|
|
"/batch",
|
|
);
|
|
expect(screen.getByRole("link", { name: "Compare" })).toHaveAttribute(
|
|
"href",
|
|
"/compare",
|
|
);
|
|
expect(screen.getByRole("link", { name: "Sources" })).toHaveAttribute(
|
|
"href",
|
|
"/sources",
|
|
);
|
|
});
|
|
});
|