mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
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
This commit is contained in:
parent
d95c3e9cd4
commit
11dd83d616
3 changed files with 7 additions and 16 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ describe("TeamMembersComponent", () => {
|
|||
renderWithProviders(
|
||||
<TeamMembersComponent
|
||||
teamData={createMockTeamData()}
|
||||
canEditTeam={false}
|
||||
canEditTeam={true}
|
||||
handleMemberDelete={mockHandleMemberDelete}
|
||||
setSelectedEditMember={mockSetSelectedEditMember}
|
||||
setIsEditMemberModalVisible={mockSetIsEditMemberModalVisible}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { render, screen } from "@testing-library/react";
|
||||
import { render, screen, within } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { LogDetailContent } from "./LogDetailContent";
|
||||
|
|
@ -341,6 +341,6 @@ describe("LogDetailContent", () => {
|
|||
|
||||
const descriptions = screen.getByText("Provider").closest(".ant-descriptions-item");
|
||||
expect(descriptions).toBeInTheDocument();
|
||||
expect(screen.getByText("-")).toBeInTheDocument();
|
||||
expect(within(descriptions as HTMLElement).getByText("-")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue