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]

test(ui): filter the default-model combobox instead of indexing into it

Yuneng Jiang48d3cb83f6f2
diff --git a/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx b/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx
index a949b37791b..f94f3306291 100644
--- a/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx
+++ b/ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx
@@ -615,7 +615,12 @@ describe("AddAutoRouterTab", () => {
// Applying a preset collapses Detailed Configuration, so the default model row is behind it.
expandDetailedConfiguration();
- await user.click(screen.getByRole("combobox", { name: "Default model" }));
+ const defaultModel = screen.getByRole("combobox", { name: "Default model" });
+ await user.click(defaultModel);
+ // antd virtualizes the option list and jsdom gives every row zero height, so options past
+ // the first window never render. Typing filters the list down to the pin instead of relying
+ // on its index, which adding a preset to the bundled JSON shifts.
+ await user.type(defaultModel, PINNED_MODEL);
await user.click((await screen.findAllByTitle(PINNED_MODEL)).slice(-1)[0]);
};