Skip to content

Commit 7d2f5b2

Browse files
author
Brain
committed
test(agents): wait for model popup before Escape
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
1 parent c363684 commit 7d2f5b2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/bundled/agents/AgentModelPicker.test.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,13 @@ it("shows Goose authentication errors while keeping manual model entry available
235235
expect(await screen.findByText(/Goose needs authentication/)).toBeVisible();
236236
const input = screen.getByRole("combobox", { name: "Model" });
237237
await waitFor(() => expect(input).not.toHaveAttribute("aria-busy"));
238+
// Authentication can finish before Base UI's next-frame trigger opens the
239+
// popup. Escape must follow that opening, not just the request completion.
240+
await waitFor(() => expect(input).toHaveAttribute("aria-expanded", "true"));
238241
await userEvent.keyboard("{Escape}");
242+
await waitFor(() =>
243+
expect(input).toHaveAttribute("aria-expanded", "false"),
244+
);
239245
expect(
240246
await screen.findByRole("button", { name: "Retry models" }),
241247
).toBeVisible();

0 commit comments

Comments
 (0)