From fbb93e2ddfe9b55ee0f7edd6e20186aac450d848 Mon Sep 17 00:00:00 2001 From: majdyz Date: Mon, 13 Apr 2026 02:15:28 +0000 Subject: [PATCH] fix(frontend-test): update renders empty dashboard assertion for 7 zero-cost cards The PR added 5 new cost summary cards (Avg Cost, P50, P75, P95, P99) that also display \$0.0000 when empty, so the test assertion needed to change from 2 to 7 matching elements. --- .../platform-costs/__tests__/PlatformCostContent.test.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/platform-costs/__tests__/PlatformCostContent.test.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/platform-costs/__tests__/PlatformCostContent.test.tsx index 5944e94ea7..e6b64041d9 100644 --- a/autogpt_platform/frontend/src/app/(platform)/admin/platform-costs/__tests__/PlatformCostContent.test.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/admin/platform-costs/__tests__/PlatformCostContent.test.tsx @@ -134,9 +134,12 @@ describe("PlatformCostContent", () => { await waitFor(() => expect(document.querySelector(".animate-pulse")).toBeNull(), ); - // Verify the two summary cards that show $0.0000 — Known Cost and Estimated Total + // Known Cost and Estimated Total cards render $0.0000 + expect(screen.getByText("Known Cost")).toBeDefined(); + expect(screen.getByText("Estimated Total")).toBeDefined(); + // All cost summary cards (Known Cost, Estimated Total, Avg Cost, P50/P75/P95/P99) show $0.0000 const zeroCostItems = screen.getAllByText("$0.0000"); - expect(zeroCostItems.length).toBe(2); + expect(zeroCostItems.length).toBe(7); expect(screen.getByText("No cost data yet")).toBeDefined(); });