feat: harden workflow gates and expose token usage
This commit is contained in:
@@ -21,6 +21,11 @@ test("sql artifact accepts a { content } wrapper", async () => {
|
||||
await screen.findByTestId("hl");
|
||||
});
|
||||
|
||||
test("an empty artifact shows an explicit fallback instead of a blank panel", () => {
|
||||
render(<ArtifactView artifact={{ kind: "sql", data: {} }} />);
|
||||
expect(screen.getByText("No artifact content available.")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("cte_plan renders an ordered list of names", () => {
|
||||
render(<ArtifactView artifact={{ kind: "cte_plan", data: { names: ["a_cte", "b_cte"] } }} />);
|
||||
expect(screen.getByText("a_cte")).toBeInTheDocument();
|
||||
|
||||
@@ -135,6 +135,9 @@ function StructuredValue({ value, depth = 0 }: { value: unknown; depth?: number
|
||||
);
|
||||
}
|
||||
const entries = Object.entries(value as Record<string, unknown>);
|
||||
if (entries.length === 0) {
|
||||
return <p className="text-sm text-muted-foreground">No artifact content available.</p>;
|
||||
}
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
{entries.map(([k, v], i) => (
|
||||
|
||||
Reference in New Issue
Block a user