test(frontend): cover ArtifactWidget view-only + multiselect allow_empty gate

This commit is contained in:
2026-06-28 12:40:09 +02:00
parent be9e761e0a
commit f933b544ff
2 changed files with 45 additions and 0 deletions
@@ -0,0 +1,21 @@
import { render, screen } from "@testing-library/react";
import { ArtifactWidget } from "./ArtifactWidget";
test("renders artifact content view-only with no response path", () => {
const onRespond = vi.fn();
render(
<ArtifactWidget
descriptor={{
id: "u1",
widget: "artifact",
artifact: { kind: "result", content: "SELECT 1" },
}}
onRespond={onRespond}
/>
);
// (a) content is rendered
expect(screen.getByText("SELECT 1")).toBeInTheDocument();
// (b) no response path: no responding button, onRespond never called
expect(screen.queryByRole("button")).not.toBeInTheDocument();
expect(onRespond).not.toHaveBeenCalled();
});