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 <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-08-17 20:12:10 +00:00
parent f04b1dadfb
commit 5af1da5692
No known key found for this signature in database

View file

@ -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]);
};