mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-07 20:22:41 +00:00
fixing test
This commit is contained in:
@@ -44,7 +44,10 @@ const renderWithForm = (props = {}) => {
|
||||
it("should default allow_all_keys switch to unchecked for new servers", async () => {
|
||||
renderWithForm();
|
||||
await expandPanel();
|
||||
const toggle = screen.getByRole("switch");
|
||||
// Find the switch associated with "Allow All LiteLLM Keys" text
|
||||
// The first switch in the component is for allow_all_keys
|
||||
const switches = screen.getAllByRole("switch");
|
||||
const toggle = switches[0];
|
||||
expect(toggle).toHaveAttribute("aria-checked", "false");
|
||||
});
|
||||
|
||||
@@ -62,7 +65,10 @@ const renderWithForm = (props = {}) => {
|
||||
});
|
||||
|
||||
const user = await expandPanel();
|
||||
const toggle = screen.getByRole("switch");
|
||||
// Find the switch associated with "Allow All LiteLLM Keys" text
|
||||
// The first switch in the component is for allow_all_keys
|
||||
const switches = screen.getAllByRole("switch");
|
||||
const toggle = switches[0];
|
||||
expect(toggle).toHaveAttribute("aria-checked", "true");
|
||||
|
||||
await user.click(toggle);
|
||||
|
||||
@@ -11,6 +11,10 @@ vi.mock("../networking", () => ({
|
||||
fetchMCPServerHealth: vi.fn(),
|
||||
deleteMCPServer: vi.fn(),
|
||||
getProxyBaseUrl: vi.fn().mockReturnValue("http://localhost:4000"),
|
||||
fetchMCPClientIp: vi.fn().mockResolvedValue(null),
|
||||
getGeneralSettingsCall: vi.fn().mockResolvedValue([]),
|
||||
updateConfigFieldSetting: vi.fn().mockResolvedValue(undefined),
|
||||
deleteConfigFieldSetting: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
// Mock NotificationsManager
|
||||
|
||||
Reference in New Issue
Block a user