Skip to content

Commit

Permalink
Wait for focus
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed May 24, 2024
1 parent 36814c6 commit 9aadc16
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/components/src/dropdown-menu-v2/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ describe( 'DropdownMenu', () => {

expect( toggleButton ).toHaveAttribute( 'aria-expanded', 'true' );

expect(
screen.getByRole( 'menu', { name: toggleButton.textContent ?? '' } )
).toHaveFocus();
await waitFor( () =>
expect(
screen.getByRole( 'menu', {
name: toggleButton.textContent ?? '',
} )
).toHaveFocus()
);

expect( screen.getByRole( 'separator' ) ).toHaveAttribute(
'aria-orientation',
'horizontal'
Expand Down

0 comments on commit 9aadc16

Please sign in to comment.