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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(ui): fix guardrails.test.tsx after antd Tabs migration
Ryan Crabbea36fe70fde0b
diff --git a/ui/litellm-dashboard/src/components/guardrails.test.tsx b/ui/litellm-dashboard/src/components/guardrails.test.tsxindex 8cafc18eb9a..99c2474347e 100644--- a/ui/litellm-dashboard/src/components/guardrails.test.tsx+++ b/ui/litellm-dashboard/src/components/guardrails.test.tsx@@ -1,4 +1,4 @@-import { render, screen } from "@testing-library/react";+import { render, screen, fireEvent } from "@testing-library/react";import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";import GuardrailsPanel from "./guardrails";import { getGuardrailsList } from "./networking";@@ -40,6 +40,10 @@ vi.mock("./guardrails/GuardrailTestPlayground", () => ({default: () => <div>Mock Guardrail Test Playground</div>,}));+vi.mock("./guardrails/TeamGuardrailsTab", () => ({+ TeamGuardrailsTab: () => <div>Mock Team Guardrails Tab</div>,+}));+vi.mock("@/utils/roles", () => ({isAdminRole: vi.fn((role: string) => role === "admin"),}));@@ -99,6 +103,8 @@ describe("GuardrailsPanel", () => {it("should render the component", async () => {render(<GuardrailsPanel {...defaultProps} />);expect(screen.getByText("Guardrails")).toBeInTheDocument();+ // Activate the Guardrails tab so its content (including the Add button) is rendered+ fireEvent.click(screen.getByText("Guardrails"));expect(screen.getByText("+ Add New Guardrail")).toBeInTheDocument();});});