From 11dd83d616462663709841afef28934728a8687d Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 21 Feb 2026 11:24:55 -0800 Subject: [PATCH] fix(ui): fix failing ui_unit_tests - TeamMemberTab: pass canEditTeam=true so Add Member button renders - UsagePageView: remove stale banner assertions (org/customer/agent banners were removed from source) - LogDetailContent: scope '-' query to Provider description item using within() to avoid multiple-match error --- .../UsagePage/components/UsagePageView.test.tsx | 17 ++++------------- .../src/components/team/TeamMemberTab.test.tsx | 2 +- .../LogDetailsDrawer/LogDetailContent.test.tsx | 4 ++-- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/ui/litellm-dashboard/src/components/UsagePage/components/UsagePageView.test.tsx b/ui/litellm-dashboard/src/components/UsagePage/components/UsagePageView.test.tsx index 5f5ffe83baa..f718171d07a 100644 --- a/ui/litellm-dashboard/src/components/UsagePage/components/UsagePageView.test.tsx +++ b/ui/litellm-dashboard/src/components/UsagePage/components/UsagePageView.test.tsx @@ -645,7 +645,6 @@ describe("UsagePage", () => { }); await waitFor(() => { - expect(screen.getByText("Organization usage is a new feature.")).toBeInTheDocument(); const entityUsageElements = screen.getAllByText("Entity Usage"); expect(entityUsageElements.length).toBeGreaterThan(0); }); @@ -1073,17 +1072,8 @@ describe("UsagePage", () => { }); await waitFor(() => { - expect(screen.getByText("Customer usage is a new feature.")).toBeInTheDocument(); - }); - - // Click the close button - const closeButton = screen.getByLabelText("Close"); - act(() => { - fireEvent.click(closeButton); - }); - - await waitFor(() => { - expect(screen.queryByText("Customer usage is a new feature.")).not.toBeInTheDocument(); + const entityUsageElements = screen.getAllByText("Entity Usage"); + expect(entityUsageElements.length).toBeGreaterThan(0); }); }); }); @@ -1108,7 +1098,8 @@ describe("UsagePage", () => { }); await waitFor(() => { - expect(screen.getByText("Agent usage (A2A) is a new feature.")).toBeInTheDocument(); + const entityUsageElements = screen.getAllByText("Entity Usage"); + expect(entityUsageElements.length).toBeGreaterThan(0); }); }); }); diff --git a/ui/litellm-dashboard/src/components/team/TeamMemberTab.test.tsx b/ui/litellm-dashboard/src/components/team/TeamMemberTab.test.tsx index d494b874e4d..ac0ae16a44f 100644 --- a/ui/litellm-dashboard/src/components/team/TeamMemberTab.test.tsx +++ b/ui/litellm-dashboard/src/components/team/TeamMemberTab.test.tsx @@ -168,7 +168,7 @@ describe("TeamMembersComponent", () => { renderWithProviders( { const descriptions = screen.getByText("Provider").closest(".ant-descriptions-item"); expect(descriptions).toBeInTheDocument(); - expect(screen.getByText("-")).toBeInTheDocument(); + expect(within(descriptions as HTMLElement).getByText("-")).toBeInTheDocument(); }); });