import assert from "node:assert/strict"; import { readFile } from "node:fs/promises"; import test from "node:test"; import { renderToReadableStream } from "hono/jsx/streaming"; import { otherEntries } from "./components/other-index.tsx"; import { PageNav } from "./components/page-nav.tsx"; import { ServicesContent } from "./components/services.tsx"; import { Shell } from "./components/shell.tsx"; import { Webring } from "./components/webring.tsx"; async function render(component: Parameters[0]): Promise { return new Response(renderToReadableStream(component)).text(); } test("site navigation keeps Services under Other", async () => { const html = await render(); const labels = [...html.matchAll(/]*>([^<]+)<\/a>/g)].map((match) => match[1]); assert.deepEqual(labels, ["About", "Blog", "Code", "Knowledge", "Other"]); assert.doesNotMatch(html, /href="\/services"/); assert.match(html, /Other<\/a>/); }); test("home navigation uses compact horizontal rails", async () => { const html = await render( , ); const css = await readFile(new URL("../public/site.css", import.meta.url), "utf8"); assert.match(html, />previous<\/a>]*>webring<\/a>]*>next<\/a>/); assert.doesNotMatch(html, />Letta webring { const html = await render( , ); const css = await readFile(new URL("../public/site.css", import.meta.url), "utf8"); const script = await readFile(new URL("../public/theme.js", import.meta.url), "utf8"); assert.match(html, /