Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(ui): isolate OldTeams delete-warning tests from leaked mock (#30871)

Mateo Wang15aa40b36e55
diff --git a/ui/litellm-dashboard/src/components/OldTeams.test.tsx b/ui/litellm-dashboard/src/components/OldTeams.test.tsx
index afd456ebc7c..d777ba1b0dc 100644
--- a/ui/litellm-dashboard/src/components/OldTeams.test.tsx
+++ b/ui/litellm-dashboard/src/components/OldTeams.test.tsx
@@ -1046,17 +1046,14 @@ describe("OldTeams - delete team warning copy", () => {
});
const openDeleteModal = async (team: any) => {
- renderWithQueryClient(
- <OldTeams
- teams={[team]}
- searchParams={{}}
- accessToken="test-token"
- setTeams={vi.fn()}
- userID="user-123"
- userRole="Admin"
- organizations={[]}
- />,
- );
+ vi.mocked(teamListCall).mockResolvedValue({
+ teams: [team],
+ total: 1,
+ page: 1,
+ page_size: 100,
+ total_pages: 1,
+ });
+ renderWithQueryClient(<OldTeams accessToken="test-token" userID="user-123" userRole="Admin" />);
await waitFor(() => {
expect(screen.getByTestId("delete-team-button")).toBeInTheDocument();
});
@@ -1081,9 +1078,9 @@ describe("OldTeams - delete team warning copy", () => {
};
it("warns that the team's models are deleted when the team has keys", async () => {
- await openDeleteModal({ ...baseTeam, keys: [], keys_count: 2 });
+ await openDeleteModal({ ...baseTeam, keys: [], keys_count: 5 });
- expect(screen.getByText(/Warning: This team has 2 keys associated with it/i)).toHaveTextContent(
+ expect(screen.getByText(/Warning: This team has 5 keys associated with it/i)).toHaveTextContent(
/along with any models created for this team/i,
);
expect(screen.getByText(/Are you sure you want to delete this team/i)).toHaveTextContent(