content-explorer/ui/components/EntityDetail.test.tsx
tegwick e16aa03393 Add registry kind indexes and entity pages.
CONTENT-WP-0002-T02 reads kinds from each snapshot and serves both example dataspaces without oncology imports.

Assistant: grok
Assistant-Session: 01a1346c-fdff-7741-b1af-b7283661554b
2026-10-13 22:56:52 +02:00

26 lines
1.1 KiB
TypeScript

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(<KindIndex kind={kind!} />);
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(<EntityDetail entity={entity!} />);
expect(html).toContain(">System boundary<");
expect(html).toContain("formal-measure");
expect(html).toContain("unknown");
expect(html).toContain("Stock and flow model");
});
});