From 8e6009101703ae1dda720e4fcf75f211b5395c98 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Wed, 19 Aug 2026 11:36:00 -0700 Subject: [PATCH] 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. --- .../components/common_components/user_search_modal.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/common_components/user_search_modal.test.tsx b/ui/litellm-dashboard/src/components/common_components/user_search_modal.test.tsx index cbaf00b7131..71ea587f88a 100644 --- a/ui/litellm-dashboard/src/components/common_components/user_search_modal.test.tsx +++ b/ui/litellm-dashboard/src/components/common_components/user_search_modal.test.tsx @@ -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());