diff --git a/packages/components/src/circular-option-picker/test/index.tsx b/packages/components/src/circular-option-picker/test/index.tsx index 48a0aca40faf3..0a168432629f8 100644 --- a/packages/components/src/circular-option-picker/test/index.tsx +++ b/packages/components/src/circular-option-picker/test/index.tsx @@ -2,7 +2,7 @@ * External dependencies */ import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; +import { press } from '@ariakit/test'; /** * Internal dependencies @@ -71,8 +71,6 @@ describe( 'CircularOptionPicker', () => { describe( 'when `loop` is not set', () => { it( 'should loop', async () => { - const user = userEvent.setup(); - render( { /> ); - await user.tab(); + await press.Tab(); expect( getOption( 'Option One' ) ).toHaveFocus(); - await user.keyboard( '[ArrowRight]' ); + await press.ArrowRight(); expect( getOption( 'Option Two' ) ).toHaveFocus(); - await user.keyboard( '[ArrowRight]' ); + await press.ArrowRight(); expect( getOption( 'Option One' ) ).toHaveFocus(); } ); } ); describe( 'when `loop` is true', () => { it( 'should loop', async () => { - const user = userEvent.setup(); - render( { /> ); - await user.tab(); + await press.Tab(); expect( getOption( 'Option One' ) ).toHaveFocus(); - await user.keyboard( '[ArrowRight]' ); + await press.ArrowRight(); expect( getOption( 'Option Two' ) ).toHaveFocus(); - await user.keyboard( '[ArrowRight]' ); + await press.ArrowRight(); expect( getOption( 'Option One' ) ).toHaveFocus(); } ); } ); describe( 'when `loop` is false', () => { it( 'should not loop', async () => { - const user = userEvent.setup(); - render( { /> ); - await user.tab(); + await press.Tab(); expect( getOption( 'Option One' ) ).toHaveFocus(); - await user.keyboard( '[ArrowRight]' ); + await press.ArrowRight(); expect( getOption( 'Option Two' ) ).toHaveFocus(); - await user.keyboard( '[ArrowRight]' ); + await press.ArrowRight(); expect( getOption( 'Option Two' ) ).toHaveFocus(); } ); } );