import { assertEquals, assertStringIncludes } from "@std/assert"; import { performanceViewHref, performanceViewNav, } from "./performance-views.ts"; const state = { repo: "loom" as const, days: 14, sort: "job", stat: "p99", }; Deno.test("performance view URLs share one canonical route and translate sort modes", () => { assertEquals( performanceViewHref("runtime", state), "/bench?view=runtime&repo=loom&days=14&sort=file&stat=p99", ); assertEquals( performanceViewHref("ci", { ...state, sort: "file" }), "/bench?view=ci&repo=loom&days=14&sort=job&stat=p99", ); assertEquals( performanceViewHref("gantt", state), "/bench?view=gantt&repo=loom&days=14&sort=job&stat=p99", ); }); Deno.test("performance view navigation marks one stable-size selector active", () => { const html = performanceViewNav("ci", state); assertStringIncludes(html, ">Runtime benchmarks"); assertStringIncludes( html, 'aria-current="page">CI duration history', ); assertStringIncludes(html, ">CI run Gantt"); });