@@ -524,12 +524,20 @@ describe('drawn as the app\'s menu (objectstack#37452)', () => {
524524 expect ( entry ( 'type:object' ) ) . toBeVisible ( ) ;
525525 } ) ;
526526
527+ // On ~all the groups are drawn flat with and without a search, so the
528+ // group the author closed is the same group the search lists into.
527529 it ( 'a search lists its matches in a group the author closed' , ( ) => {
528- renderAt ( `/studio/${ PKG } /data` ) ;
529- fireEvent . click ( groupLabel ( 'studio-menu-group-automation' ) ) ;
530- expect ( screen . queryByTestId ( 'studio-menu-entry-type:flow' ) ) . toBeNull ( ) ;
531- fireEvent . change ( screen . getByTestId ( 'studio-menu-search' ) , { target : { value : 'flow' } } ) ;
532- expect ( entry ( 'type:flow' ) ) . toBeVisible ( ) ;
530+ renderAt ( '/studio/~all/metadata' , '~all' ) ;
531+ const label = groupLabel ( 'studio-menu-group-security' ) ;
532+ fireEvent . click ( label ) ;
533+ expect ( label ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
534+ expect ( screen . queryByTestId ( 'studio-menu-entry-type:position' ) ) . toBeNull ( ) ;
535+ fireEvent . change ( screen . getByTestId ( 'studio-menu-search' ) , { target : { value : 'position' } } ) ;
536+ expect ( entry ( 'type:position' ) ) . toBeVisible ( ) ;
537+ expect ( groupLabel ( 'studio-menu-group-security' ) ) . toHaveAttribute ( 'aria-expanded' , 'true' ) ;
538+ // The author's choice is kept: clearing the search closes it again.
539+ fireEvent . change ( screen . getByTestId ( 'studio-menu-search' ) , { target : { value : '' } } ) ;
540+ expect ( screen . queryByTestId ( 'studio-menu-entry-type:position' ) ) . toBeNull ( ) ;
533541 } ) ;
534542
535543 it ( 'an entry draws a bare line icon before its name, on the app menu\'s row' , ( ) => {
0 commit comments