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>
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { stageForElapsed } from "../components/VerifyStepper";
|
|
|
|
describe("stageForElapsed", () => {
|
|
it("returns stage 0 at zero elapsed time", () => {
|
|
expect(stageForElapsed(0, 4)).toBe(0);
|
|
});
|
|
|
|
it("returns stage 0 for negative elapsed time", () => {
|
|
expect(stageForElapsed(-500, 4)).toBe(0);
|
|
});
|
|
|
|
it("advances to the correct index mid-progress", () => {
|
|
// At the default 1600ms interval, ~3.3s in is stage 2.
|
|
expect(stageForElapsed(3300, 4)).toBe(2);
|
|
// Just under the second interval boundary is still stage 0.
|
|
expect(stageForElapsed(1599, 4)).toBe(0);
|
|
// Exactly one interval elapsed advances to stage 1.
|
|
expect(stageForElapsed(1600, 4)).toBe(1);
|
|
});
|
|
|
|
it("respects a custom interval", () => {
|
|
expect(stageForElapsed(2500, 4, 1000)).toBe(2);
|
|
});
|
|
|
|
it("caps at count - 1 for huge elapsed times", () => {
|
|
expect(stageForElapsed(1_000_000, 4)).toBe(3);
|
|
});
|
|
|
|
it("returns 0 for a non-positive count", () => {
|
|
expect(stageForElapsed(5000, 0)).toBe(0);
|
|
});
|
|
});
|