test(ui): await the playground model combobox before clicking it

The ChatUI playground test helper looked up the model combobox with a
synchronous getByPlaceholderText. That control renders its placeholder
from the model-loading flag, so the text is "Loading models..." until
the mocked fetch resolves, and the element the helper wants does not
exist yet. Under a loaded full-suite run the query could land inside
that window and fail with "Unable to find an element with the
placeholder text of: Select a Model", while the same test passed in
isolation every time.

Switch the helper to findByPlaceholderText so it waits for the control
to come back after loading.
This commit is contained in:
Yuneng Jiang 2026-08-13 18:08:45 -07:00
parent e0f388cb5c
commit f861af42c0
No known key found for this signature in database

View file

@ -35,7 +35,7 @@ const STREAMING_ENABLED_ARG_INDEX = 25;
async function openComboboxByPlaceholder(placeholder: string) {
const user = userEvent.setup();
const combobox = screen.getByPlaceholderText(placeholder);
const combobox = await screen.findByPlaceholderText(placeholder);
await user.click(combobox);
return combobox;
}