test(frontend): cover ArtifactWidget view-only + multiselect allow_empty gate
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user