File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -465,6 +465,22 @@ it('Activates the click handler of a menu item after pressing enter while focuse
465465 expect ( console . log ) . toHaveBeenCalledWith ( 'Item one clicked' ) ;
466466} ) ;
467467
468+ it ( 'Closes the menu after pressing space on a menu item with a click handler' , ( ) => {
469+ render ( < TestComponent /> ) ;
470+
471+ userEvent . tab ( ) ;
472+
473+ userEvent . type ( screen . getByText ( 'Primary' ) , '{enter}' , {
474+ skipClick : true ,
475+ } ) ;
476+
477+ userEvent . type ( screen . getByText ( 'Item 1' ) , '{space}' , {
478+ skipClick : true ,
479+ } ) ;
480+
481+ expect ( screen . getByTestId ( 'is-open-indicator' ) ) . toHaveTextContent ( 'false' ) ;
482+ } ) ;
483+
468484it ( 'Activates the click handler of a menu item after pressing space while focused on it' , ( ) => {
469485 render ( < TestComponent /> ) ;
470486
You can’t perform that action at this time.
0 commit comments