feat(gate): render reviewer artifacts in a 90% modal (fix empty artifact.data gate)
This commit is contained in:
@@ -2,19 +2,25 @@ import { render, screen } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { ArtifactGateWidget } from "./ArtifactGateWidget";
|
||||
|
||||
test("renders artifact content in a pre block", () => {
|
||||
vi.mock("../viewers/mermaid", () => ({
|
||||
renderMermaid: vi.fn().mockResolvedValue('<svg data-testid="mm"></svg>'),
|
||||
}));
|
||||
|
||||
test("renders inside a dialog and shows the artifact via ArtifactView (data path)", () => {
|
||||
const onRespond = vi.fn();
|
||||
render(
|
||||
<ArtifactGateWidget
|
||||
descriptor={{
|
||||
id: "u1",
|
||||
widget: "artifact-gate",
|
||||
artifact: { kind: "cte", content: "SELECT 42" },
|
||||
title: "SQL finale",
|
||||
artifact: { kind: "sql", data: "SELECT 42" },
|
||||
options: [{ id: "approve", label: "Approva" }],
|
||||
}}
|
||||
onRespond={onRespond}
|
||||
/>
|
||||
);
|
||||
expect(screen.getByRole("dialog")).toBeInTheDocument();
|
||||
expect(screen.getByText("SELECT 42")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user