test(ui): open the member role select by keyboard so the payload test stops flaking

The base-ui select defers its mousedown open into a requestAnimationFrame, so
under CI load the popup can miss findByRole's 1s budget and the role option is
never found. Opening with Enter runs the open synchronously, and the option is
still picked by mouse, so the payload assertion covers the same contract.
This commit is contained in:
Yuneng Jiang 2026-08-19 11:36:00 -07:00
parent da7a10ebbd
commit 8e60091017
No known key found for this signature in database

View file

@ -130,7 +130,8 @@ describe("UserSearchModal submit payload", () => {
const { onSubmit } = setup();
const user = userEvent.setup({ pointerEventsCheck: PointerEventsCheckLevel.Never });
await user.click(screen.getByLabelText("Member Role"));
act(() => screen.getByLabelText("Member Role").focus());
await user.keyboard("{Enter}");
await user.click(await screen.findByRole("option", { name: /^admin/ }));
await user.click(save());