mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
Add test for user_id display in key info view
- Test verifies user_id is displayed in the component - Uses getAllByText since user_id appears in both overview and settings tabs Co-authored-by: ishaan <ishaan@berri.ai>
This commit is contained in:
parent
8691198d7d
commit
6de2a5f1d8
1 changed files with 23 additions and 0 deletions
|
|
@ -320,4 +320,27 @@ describe("KeyInfoView", () => {
|
|||
expect(screen.queryByText("Delete Key")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("should display user_id in the overview section", async () => {
|
||||
vi.mocked(useAuthorized).mockReturnValue(baseUseAuthorizedMock);
|
||||
|
||||
render(
|
||||
<KeyInfoView
|
||||
keyData={MOCK_KEY_DATA}
|
||||
onClose={() => {}}
|
||||
keyId={"test-key-id"}
|
||||
onKeyDataUpdate={() => {}}
|
||||
teams={[]}
|
||||
/>,
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
// User ID appears in multiple places (overview and settings tab)
|
||||
const userIdElements = screen.getAllByText("User ID");
|
||||
expect(userIdElements.length).toBeGreaterThan(0);
|
||||
// Verify the user_id value is displayed
|
||||
const userIdValues = screen.getAllByText("default_user_id");
|
||||
expect(userIdValues.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue