@@ -395,7 +395,7 @@ for (const useModernActionList of [false, true]) {
395395 )
396396 } )
397397
398- it ( 'should support navigating through items with PageDown and PageUp' , async ( ) => {
398+ it ( 'should support navigating through items with PageDown and PageUp (modern ActionList) ' , async ( ) => {
399399 if ( ! useModernActionList ) return // this feature is only enabled with feature flag on
400400
401401 const user = userEvent . setup ( )
@@ -694,10 +694,11 @@ for (const useModernActionList of [false, true]) {
694694 jest . runAllTimers ( )
695695 // we wait because announcement is intentionally updated after a timeout to not interrupt user input
696696 await waitFor ( async ( ) => {
697+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
697698 if ( useModernActionList ) {
698- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ? .trim ( ) ) . toEqual ( '3 items.' )
699+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ! . trim ( ) ) . toEqual ( '3 items available, 0 selected .' )
699700 } else {
700- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ? .trim ( ) ) . toEqual (
701+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ! . trim ( ) ) . toEqual (
701702 'List updated, Focused item: item one, not selected, 1 of 3' ,
702703 )
703704 }
@@ -752,7 +753,7 @@ for (const useModernActionList of [false, true]) {
752753 await user . click ( screen . getByText ( 'Select items' ) )
753754 expect ( screen . getByLabelText ( 'Filter items' ) ) . toHaveFocus ( )
754755
755- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ? .trim ( ) ) . toContain ( 'This is a notice' )
756+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ! . trim ( ) ) . toContain ( 'This is a notice' )
756757 } )
757758
758759 it ( 'should announce filtered results' , async ( ) => {
@@ -768,10 +769,11 @@ for (const useModernActionList of [false, true]) {
768769 jest . runAllTimers ( )
769770 await waitFor (
770771 async ( ) => {
772+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
771773 if ( useModernActionList ) {
772- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ? .trim ( ) ) . toEqual ( '3 items.' )
774+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ! . trim ( ) ) . toEqual ( '3 items available, 0 selected .' )
773775 } else {
774- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ? .trim ( ) ) . toEqual (
776+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ! . trim ( ) ) . toEqual (
775777 'List updated, Focused item: item one, not selected, 1 of 3' ,
776778 )
777779 }
@@ -785,8 +787,9 @@ for (const useModernActionList of [false, true]) {
785787 jest . runAllTimers ( )
786788 await waitFor (
787789 async ( ) => {
790+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
788791 if ( useModernActionList ) {
789- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ) . toBe ( '2 items.' )
792+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ) . toBe ( '2 items available, 0 selected .' )
790793 } else {
791794 expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ) . toBe (
792795 'List updated, Focused item: item one, not selected, 1 of 2' ,
@@ -801,10 +804,11 @@ for (const useModernActionList of [false, true]) {
801804
802805 jest . runAllTimers ( )
803806 await waitFor ( async ( ) => {
807+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
804808 if ( useModernActionList ) {
805- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ? .trim ( ) ) . toBe ( '1 items .' )
809+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ! . trim ( ) ) . toBe ( '1 item available, 0 selected .' )
806810 } else {
807- expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ? .trim ( ) ) . toBe (
811+ expect ( getLiveRegion ( ) . getMessage ( 'polite' ) ! . trim ( ) ) . toBe (
808812 'List updated, Focused item: item one, not selected, 1 of 1' ,
809813 )
810814 }
0 commit comments