File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/react-aria-components/test Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1863,15 +1863,15 @@ describe('ListBox', () => {
18631863 } ) ;
18641864
18651865 describe ( 'onKeyDown' , ( ) => {
1866- it ( 'should call onKeyDown handler when key is pressed on item' , ( ) => {
1866+ it ( 'should call onKeyDown handler when key is pressed on item' , async ( ) => {
18671867 let onKeyDown = jest . fn ( ) ;
1868- let { getAllByRole} = renderListbox ( { } , { onKeyDown} ) ;
1869- let options = getAllByRole ( 'option' ) ;
1868+ renderListbox ( { } , { onKeyDown} ) ;
18701869
1871- fireEvent . keyDown ( options [ 0 ] , { key : 'Delete' } ) ;
1870+ await user . tab ( ) ;
1871+ await user . keyboard ( '{Delete}' ) ;
18721872 expect ( onKeyDown ) . toHaveBeenCalledTimes ( 1 ) ;
18731873
1874- fireEvent . keyDown ( options [ 1 ] , { key : ' Backspace' } ) ;
1874+ await user . keyboard ( '{ Backspace}' ) ;
18751875 expect ( onKeyDown ) . toHaveBeenCalledTimes ( 2 ) ;
18761876 } ) ;
18771877 } ) ;
You can’t perform that action at this time.
0 commit comments