Fix flaky tests

This commit is contained in:
yuneng-jiang 2025-11-27 17:40:38 -08:00
parent fb5429bfe7
commit 0d329826f1

View file

@ -168,16 +168,18 @@ describe("EntityUsage", () => {
});
it("should render with organization entity type and call organization API", async () => {
const { getByText, getAllByText } = render(<EntityUsage {...defaultProps} entityType="organization" />);
render(<EntityUsage {...defaultProps} entityType="organization" />);
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 () => {