fix: improve cte review presentation

This commit is contained in:
User
2026-07-14 15:08:10 +02:00
parent 27af6733c8
commit 18701f020e
6 changed files with 147 additions and 75 deletions
+13 -1
View File
@@ -1,4 +1,4 @@
import { render, screen } from "@testing-library/react";
import { render, screen, within } from "@testing-library/react";
import { CtePlanViewer } from "./CtePlanViewer";
import type { CtePlanV2 } from "./artifactV2";
@@ -56,6 +56,18 @@ test("renders one card per CTE with index badge, purpose, and filter value", ()
expect(screen.getByText(/TRUE/)).toBeInTheDocument();
});
test("renders each filter as aligned column, operator, and value fields", () => {
render(<CtePlanViewer plan={plan} />);
const filter = screen.getByRole("group", { name: "Filter 1" });
expect(within(filter).getByText("Column")).toBeInTheDocument();
expect(within(filter).getByText("Operator")).toBeInTheDocument();
expect(within(filter).getByText("Value")).toBeInTheDocument();
expect(within(filter).getByText("pazienti.stato")).toBeInTheDocument();
expect(within(filter).getByText("IS")).toBeInTheDocument();
expect(within(filter).getByText("TRUE")).toBeInTheDocument();
});
test("shows 'no dependencies' for a CTE with an empty depends_on", () => {
render(<CtePlanViewer plan={plan} />);
expect(screen.getByText(/no dependencies/i)).toBeInTheDocument();