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 { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { render, screen } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { CloudZeroIntegrationSettings } from "./CloudZeroIntegrationSettings";
import { CloudZeroSettings } from "./types";
vi.mock("@/app/(dashboard)/hooks/useAuthorized", () => ({
__esModule: true,
default: () => ({
accessToken: "test-token",
}),
}));
vi.mock("@/app/(dashboard)/hooks/cloudzero/useCloudZeroDryRun", () => ({
useCloudZeroDryRun: () => ({
mutate: vi.fn(),
isPending: false,
data: null,
}),
}));
vi.mock("@/app/(dashboard)/hooks/cloudzero/useCloudZeroExport", () => ({
useCloudZeroExport: () => ({
mutate: vi.fn(),
isPending: false,
}),
}));
describe("CloudZeroIntegrationSettings", () => {
let queryClient: QueryClient;
const mockSettings: CloudZeroSettings = {
connection_id: "test-connection-id",
api_key_masked: "****",
timezone: "UTC",
status: "Active",
};
beforeEach(() => {
queryClient = new QueryClient({
defaultOptions: {
queries: { retry: false },
mutations: { retry: false },
},
});
});
it("should render", () => {
render(
<QueryClientProvider client={queryClient}>
<CloudZeroIntegrationSettings settings={mockSettings} onSettingsUpdated={vi.fn()} />
</QueryClientProvider>,
);
expect(screen.getByText("CloudZero Configuration")).toBeInTheDocument();
expect(screen.getByText("API Key (Redacted)")).toBeInTheDocument();
expect(screen.getByText("Connection ID")).toBeInTheDocument();
expect(screen.getByText("Timezone")).toBeInTheDocument();
});
it("should display the correct values from settings", () => {
render(
<QueryClientProvider client={queryClient}>
<CloudZeroIntegrationSettings settings={mockSettings} onSettingsUpdated={vi.fn()} />
</QueryClientProvider>,
);
expect(screen.getByText(mockSettings.api_key_masked)).toBeInTheDocument();
expect(screen.getByText(mockSettings.connection_id)).toBeInTheDocument();
});
});