diff --git a/apps/fabro-web/app/routes/run-billing.test.tsx b/apps/fabro-web/app/routes/run-billing.test.tsx index ab733b53b..3cc3ff60e 100644 --- a/apps/fabro-web/app/routes/run-billing.test.tsx +++ b/apps/fabro-web/app/routes/run-billing.test.tsx @@ -66,7 +66,7 @@ describe("RunBilling", () => { delete (globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT; }); - test("hides completed non-billable stages but still renders the totals row", () => { + test("shows a no-model-usage empty state when every stage is non-billable", () => { const renderer = renderBilling( billing({ stages: [ @@ -93,12 +93,12 @@ describe("RunBilling", () => { ); const text = textFromNode(renderer.toJSON()); + expect(text).toContain("No model usage"); + expect(text).toContain("This run didn't call any AI models."); + expect(text).not.toContain("No stages yet"); + expect(text).not.toContain("By model"); expect(text).not.toContain("start"); expect(text).not.toContain("command"); - expect(text).toMatch(/—\s*\/\s*—/); - expect(text).toContain("1m 1s"); - expect(text).not.toContain("By model"); - expect(text).not.toContain("No stages yet"); }); test("renders mixed LLM and non-LLM rows while counting only LLM rows by model", () => { diff --git a/apps/fabro-web/app/routes/run-billing.tsx b/apps/fabro-web/app/routes/run-billing.tsx index 2d8a4cb61..9c7323bdf 100644 --- a/apps/fabro-web/app/routes/run-billing.tsx +++ b/apps/fabro-web/app/routes/run-billing.tsx @@ -121,13 +121,18 @@ export default function RunBilling({ params }: { params: { id: string } }) { : null; const totalUsdMicros = billing?.totals.total_usd_micros; const modelStageCount = modelBreakdown.reduce((sum, row) => sum + row.stages, 0); + const visibleRows = rows.filter(isVisibleRow); - if (!rows.length) { + if (!visibleRows.length) { return (
); @@ -147,7 +152,7 @@ export default function RunBilling({ params }: { params: { id: string } }) { - {rows.filter(isVisibleRow).map((row) => ( + {visibleRows.map((row) => ( {row.stage}