diff --git a/ui/litellm-dashboard/src/components/entity_usage.test.tsx b/ui/litellm-dashboard/src/components/entity_usage.test.tsx index d5cc503fd10..17016b6479d 100644 --- a/ui/litellm-dashboard/src/components/entity_usage.test.tsx +++ b/ui/litellm-dashboard/src/components/entity_usage.test.tsx @@ -168,16 +168,18 @@ describe("EntityUsage", () => { }); it("should render with organization entity type and call organization API", async () => { - const { getByText, getAllByText } = render(); + render(); await waitFor(() => { expect(mockOrganizationDailyActivityCall).toHaveBeenCalled(); }); - expect(getByText("Organization Spend Overview")).toBeInTheDocument(); + expect(screen.getByText("Organization Spend Overview")).toBeInTheDocument(); - const spendElements = getAllByText("$100.50"); - expect(spendElements.length).toBeGreaterThan(0); + await waitFor(() => { + const spendElements = screen.getAllByText("$100.50"); + expect(spendElements.length).toBeGreaterThan(0); + }); }); it("should switch between tabs", async () => {