import { renderToStaticMarkup } from "react-dom/server"; import { describe, expect, it } from "vitest"; import { findEntity, findKind } from "@/lib/catalog"; import { EntityDetail } from "./EntityDetail"; import { KindIndex } from "./KindIndex"; describe("kind and detail views", () => { it("renders the registry plural and a linked record", () => { const kind = findKind("software-architecture", "concept"); expect(kind).not.toBeNull(); const html = renderToStaticMarkup(); expect(html).toContain(">Concepts<"); expect(html).toContain("Coupling"); expect(html).toContain('href="/software-architecture/concept/coupling/"'); }); it("renders the entity title, an unknown claim, and a neighbour", () => { const entity = findEntity("systems-thinking", "concept", "system-boundary"); expect(entity).not.toBeNull(); const html = renderToStaticMarkup(); expect(html).toContain(">System boundary<"); expect(html).toContain("formal-measure"); expect(html).toContain("unknown"); expect(html).toContain("Stock and flow model"); }); });