// The components' markup, rendered on the server the way a page renders it: what a screen reader // and a keyboard user get is in the HTML — a name for every control, a status that says what a // colour would, and the AI disclosure where AI output appears. import { buildRegistry } from "@conusai-kit/core" import { createI18n } from "@conusai-kit/i18n" import { TransportProvider } from "@conusai-kit/ui" import { renderToStaticMarkup } from "react-dom/server" import { describe, expect, it } from "vitest" import { appModules } from "../../index.js" import { searchFormLabels } from "../ui/labels.js" import { SearchForm } from "../ui/search-form.js" import { SettingsSection } from "../ui/settings-section.js" const catalogues = buildRegistry([...appModules]).catalogues const i18n = createI18n("en", { en: { knowledge: catalogues.en?.knowledge ?? {} } }) const t = (key: string, values?: Record) => i18n.message(`knowledge.${key}`, values) const failed = "That did not work: {detail}" const slugs = { org: "acme", workspace: "ws", project: "p" } const inProvider = (node: React.ReactNode) => renderToStaticMarkup( undefined} describe={() => "x"}> {node} , ) describe("the search form", () => { const html = inProvider() it("names its controls and carries the AI disclosure", () => { expect(html).toContain(`