Skip to content

Commit 5cf388c

Browse files
committed
test(locale-picker): close the popup synchronously in the aria-hidden assertion
1 parent 98792b6 commit 5cf388c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎test/locale-picker.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,10 @@ describe("LocalePicker closing motion", () => {
644644
await userEvent.click(trigger());
645645
expect(popupPanel()).not.toHaveAttribute("aria-hidden");
646646

647-
await userEvent.click(trigger()); // close — the exit animation starts
647+
// Synchronous close: nothing awaits before the assertion below, so the
648+
// 0.15s exit animation cannot have unmounted the panel first — a real
649+
// `userEvent.click` yields long enough for it to finish on slow machines.
650+
fireEvent.click(trigger());
648651

649652
expect(popupPanel()).toHaveAttribute("aria-hidden", "true");
650653
await waitFor(() => expect(screen.queryByRole("listbox")).toBeNull());

0 commit comments

Comments
 (0)