Files
ThothII/frontend/src/widgets/ArtifactWidget.test.tsx
T

22 lines
688 B
TypeScript

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();
});