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]

adding tests

yuneng-jiangb21b156e5567
diff --git a/ui/litellm-dashboard/src/components/all_keys_table.test.tsx b/ui/litellm-dashboard/src/components/all_keys_table.test.tsx
index 201a4be75bd..1458143d77e 100644
--- a/ui/litellm-dashboard/src/components/all_keys_table.test.tsx
+++ b/ui/litellm-dashboard/src/components/all_keys_table.test.tsx
@@ -93,6 +93,10 @@ const mockKey: KeyResponse = {
user_tpm_limit: 1000,
user_rpm_limit: 100,
user_email: "[email protected]",
+ user: {
+ user_email: "[email protected]",
+ user_id: "user-1",
+ },
};
const mockTeam: Team = {
@@ -190,3 +194,35 @@ it("should display key information correctly", async () => {
expect(screen.getByText("5.5000")).toBeInTheDocument();
});
});
+
+it("should display user email correctly", async () => {
+ const mockProps = {
+ keys: [mockKey],
+ setKeys: vi.fn(),
+ isLoading: false,
+ pagination: {
+ currentPage: 1,
+ totalPages: 1,
+ totalCount: 1,
+ },
+ onPageChange: vi.fn(),
+ pageSize: 50,
+ teams: [mockTeam],
+ selectedTeam: null,
+ setSelectedTeam: vi.fn(),
+ selectedKeyAlias: null,
+ setSelectedKeyAlias: vi.fn(),
+ accessToken: "test-token",
+ userID: "user-1",
+ userRole: "admin",
+ organizations: [mockOrganization],
+ setCurrentOrg: vi.fn(),
+ premiumUser: false,
+ };
+
+ renderWithProviders(<AllKeysTable {...mockProps} />);
+
+ await waitFor(() => {
+ expect(screen.getByText("[email protected]")).toBeInTheDocument();
+ });
+});
diff --git a/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx b/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx
index 9f95ba46cc1..a04fbf3943d 100644
--- a/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx
+++ b/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx
@@ -91,6 +91,10 @@ export interface KeyResponse {
last_rotation_at?: string;
key_rotation_at?: string;
next_rotation_at?: string;
+ user?: {
+ user_id: string;
+ user_email: string;
+ };
}
interface KeyListResponse {