mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
This reverts commit 9b1f78ffa7.
This commit is contained in:
parent
9b1f78ffa7
commit
0806a3e54f
2 changed files with 1 additions and 30 deletions
|
|
@ -34,7 +34,6 @@ const mockCallbacksResponse = {
|
|||
routing_strategy: "simple-shuffle",
|
||||
num_retries: 3,
|
||||
timeout: 30,
|
||||
routing_groups: [],
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -135,34 +134,6 @@ describe("RouterSettings", () => {
|
|||
);
|
||||
});
|
||||
|
||||
it("should send routing_groups as a list when saving load balancing settings", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderWithProviders(<RouterSettings {...defaultProps} />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByRole("textbox", { name: /routing_groups/i })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
await user.click(screen.getByRole("button", { name: /save changes/i }));
|
||||
|
||||
expect(setCallbacksCall).toHaveBeenCalledWith(
|
||||
"test-token",
|
||||
expect.objectContaining({
|
||||
router_settings: expect.objectContaining({
|
||||
routing_groups: [],
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expect(setCallbacksCall).not.toHaveBeenCalledWith(
|
||||
"test-token",
|
||||
expect.objectContaining({
|
||||
router_settings: expect.objectContaining({
|
||||
routing_groups: "[]",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("should show a success notification after saving", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderWithProviders(<RouterSettings {...defaultProps} />);
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ const RouterSettings: React.FC<RouterSettingsProps> = ({ accessToken, userRole,
|
|||
console.log("router_settings", router_settings);
|
||||
|
||||
const numberKeys = new Set(["allowed_fails", "cooldown_time", "num_retries", "timeout", "retry_after"]);
|
||||
const jsonKeys = new Set(["model_group_alias", "retry_policy", "routing_groups"]);
|
||||
const jsonKeys = new Set(["model_group_alias", "retry_policy"]);
|
||||
|
||||
const parseInputValue = (key: string, raw: string | undefined, fallback: unknown) => {
|
||||
if (raw === undefined) return fallback;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue