import { renderToStaticMarkup } from "react-dom/server"; import { expect, it, vi } from "vitest"; import { ImportSourceDiagnostics } from "./import-source-diagnostics"; vi.mock("next-intl", () => ({ useTranslations: () => (key: string, args?: Record) => `${key}${args?.status ?? ""}`, })); it("shows filenames, attempted addresses and distinct reasons inline", () => { const html = renderToStaticMarkup( , ); expect(html).toContain("chair.swf"); expect(html).toContain("http404"); expect(html).toContain("timeout"); expect(html).toContain("https://source.test/1/chair.swf"); expect(html).not.toContain("href="); }); it("does not invent diagnostics for earlier responses", () => { expect( renderToStaticMarkup( , ), ).toBe(""); });