From 98fae6845ae2f4f12d2f783cc783b9a0342bfeb2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 17 Aug 2026 18:16:33 +0000 Subject: [PATCH] test(ui): filter the Default model pin combobox by typing, not by virtualized index The 'default model pin' tests picked the pin out of the antd Select by title, which only works while the pin is inside the (virtualized) options list's visible viewport. Adding a third bundled preset in #37068 grew the mocked model set, pushed the pin below the viewport, and reddened the tests on staging even though nothing about the production pin behaviour changed. Typing filters the Select down to the pin so the match is not sensitive to where the pin lands in the list. Co-authored-by: Krrish Dholakia --- .../src/components/add_model/add_auto_router_tab.test.tsx | 7 ++++++- 1 file changed, 6 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..454b706415f 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,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 defaultModelCombobox = screen.getByRole("combobox", { name: "Default model" }); + await user.click(defaultModelCombobox); + // Typing filters the antd Select down to the pin so the match does not depend on where the + // pin lands in the (virtualized) options list; adding another preset to the bundled JSON has + // in the past pushed the pin below the visible viewport and reddened this test. + await user.type(defaultModelCombobox, PINNED_MODEL); await user.click((await screen.findAllByTitle(PINNED_MODEL)).slice(-1)[0]); };