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
import { screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { renderWithProviders } from "../../../../../../tests/test-utils";
import AddSSOSettingsModal from "./AddSSOSettingsModal";
// Mock networking functions
vi.mock("@/components/networking", () => ({
updateSSOSettings: vi.fn(),
}));
// Mock error utils
vi.mock("@/components/shared/errorUtils", () => ({
parseErrorMessage: vi.fn((error) => error?.message || "Unknown error"),
}));
// Mock the useAuthorized hook
vi.mock("@/app/(dashboard)/hooks/useAuthorized", () => ({
default: () => ({
accessToken: "test-access-token",
userId: "test-user-id",
userEmail: "[email protected]",
userRole: "admin",
}),
}));
describe("AddSSOSettingsModal", () => {
it("should render", () => {
const onCancel = vi.fn();
const onSuccess = vi.fn();
renderWithProviders(<AddSSOSettingsModal isVisible={true} onCancel={onCancel} onSuccess={onSuccess} />);
expect(screen.getByText("SSO Provider")).toBeInTheDocument();
expect(screen.getByText("Cancel")).toBeInTheDocument();
expect(screen.getAllByText("Add SSO")).toHaveLength(2); // Title and button
});
});