import assert from "node:assert/strict"; import test from "node:test"; import { pageTitle } from "../src/lib/page-title.ts"; const MISSING = "Page not found"; // Guards #2115: opening a dashboard page by URL showed "Page not found" in the // tab until the router resolved the address, because the start location has no // label and the not-found copy stood in for it. test("an unresolved route writes no title", () => { assert.equal(pageTitle(false, "", "", "archie", MISSING), ""); }); test("a resolved route names its page", () => { assert.equal(pageTitle(true, "Models", "Instance", "carina", MISSING), "Models | Instance | Archie | carina"); }); test("a resolved route with no page is the one that reads as not found", () => { assert.equal(pageTitle(true, "", "", "carina", MISSING), "Page not found | Archie | carina"); });