import { describe, it, expect } from "vitest"; import { renderToStaticMarkup } from "react-dom/server"; import { renderGenerativeUI } from "../renderGenerativeUI"; import { factVocabulary } from "./fact"; const render = (node: unknown) => renderToStaticMarkup(<>{renderGenerativeUI(node, factVocabulary)}); describe("factVocabulary", () => { it("Fact renders a label/value pair inside a dl", () => { expect(render({ $type: "Fact", label: "Status", value: "open" })).toBe( '
Status
open
', ); }); it("Fact ignores malformed text properties", () => { expect( render({ $type: "Fact", label: { unexpected: true }, value: { unexpected: true }, }), ).toBe( '
', ); }); });