From 5af1da5692eddbaf74af939cdb62e7d0b84ae776 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 17 Aug 2026 20:12:10 +0000 Subject: [PATCH] test(ui): filter the Default Model combobox to reach the pin past virtualization The default-model-pin tests open the Default Model select and click the option titled pinned-default-model, but AntdSelect virtualizes its options and JSDOM has no layout, so only the first ~10 options render. The Lite preset (#37068) grew the shared ALL_FAMILY_MODELS list past that window, pushing PINNED_MODEL out of the DOM and turning both pin tests red on litellm_internal_staging. Type the pin's name into the search-enabled select so only the pin renders, sidestepping virtualization instead of scrolling a JSDOM list that never has a real viewport. Co-authored-by: Krrish Dholakia --- .../src/components/add_model/add_auto_router_tab.test.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 6e71f64bcbd..6b47cf3892d 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 @@ -616,7 +616,13 @@ 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 defaultModelCombobox = screen.getByRole("combobox", { name: "Default model" }); + await user.click(defaultModelCombobox); + // Filter the options via the search input rather than scroll: the select is virtualized, + // and JSDOM's zero-height layout means options past the visible window (o3, PINNED_MODEL + // with the current presets) never render at all. Typing the pin's name reduces the list to + // just the pin, dodging the virtualization entirely. + await user.keyboard(PINNED_MODEL); await user.click((await screen.findAllByTitle(PINNED_MODEL)).slice(-1)[0]); };