mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
Adding tests
This commit is contained in:
parent
42e437a418
commit
b1dd8bf3e1
1 changed files with 28 additions and 0 deletions
|
|
@ -236,3 +236,31 @@ it("should display user email correctly", async () => {
|
|||
expect(screen.getByText("user@example.com")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("should show skeleton loaders when isLoading is true", () => {
|
||||
// Mock loading state
|
||||
mockUseKeys.mockReturnValue({
|
||||
data: null,
|
||||
isPending: true,
|
||||
refetch: vi.fn(),
|
||||
} as any);
|
||||
|
||||
const mockProps = {
|
||||
teams: [mockTeam],
|
||||
organizations: [mockOrganization],
|
||||
onSortChange: vi.fn(),
|
||||
currentSort: {
|
||||
sortBy: "created_at",
|
||||
sortOrder: "desc" as const,
|
||||
},
|
||||
};
|
||||
|
||||
renderWithProviders(<VirtualKeysTable {...mockProps} />);
|
||||
|
||||
// Check that loading message is shown
|
||||
expect(screen.getByText("🚅 Loading keys...")).toBeInTheDocument();
|
||||
|
||||
// Check that actual key data is not shown
|
||||
expect(screen.queryByText("Test Key Alias")).not.toBeInTheDocument();
|
||||
expect(screen.queryByText("Test Team")).not.toBeInTheDocument();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue