@@ -135,12 +135,8 @@ function signInAndGetAppWithUnreadChat(): Promise<void> {
135135 const hintText = translateLocal ( 'loginForm.loginForm' ) ;
136136 const loginForm = screen . queryAllByLabelText ( hintText ) ;
137137 expect ( loginForm ) . toHaveLength ( 1 ) ;
138-
139- await act ( async ( ) => {
140- await TestHelper . signInWithTestUser ( USER_A_ACCOUNT_ID , USER_A_EMAIL , undefined , undefined , 'A' ) ;
141- } ) ;
142- return waitForBatchedUpdatesWithAct ( ) ;
143138 } )
139+ . then ( async ( ) => TestHelper . signInWithTestUser ( USER_A_ACCOUNT_ID , USER_A_EMAIL , undefined , undefined , 'A' ) )
144140 . then ( ( ) => {
145141 subscribeToUserEvents ( ) ;
146142 return waitForBatchedUpdates ( ) ;
@@ -220,7 +216,7 @@ describe('Unread Indicators', () => {
220216 return navigateToSidebarOption ( 0 ) ;
221217 } )
222218 . then ( async ( ) => {
223- await act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
219+ act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
224220
225221 // That the report actions are visible along with the created action
226222 const welcomeMessageHintText = translateLocal ( 'accessibilityHints.chatWelcomeMessage' ) ;
@@ -244,8 +240,8 @@ describe('Unread Indicators', () => {
244240 signInAndGetAppWithUnreadChat ( )
245241 // Navigate to the unread chat from the sidebar
246242 . then ( ( ) => navigateToSidebarOption ( 0 ) )
247- . then ( async ( ) => {
248- await act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
243+ . then ( ( ) => {
244+ act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
249245 // Verify the unread indicator is present
250246 const newMessageLineIndicatorHintText = translateLocal ( 'accessibilityHints.newMessageLineIndicator' ) ;
251247 const unreadIndicator = screen . queryAllByLabelText ( newMessageLineIndicatorHintText ) ;
@@ -366,8 +362,8 @@ describe('Unread Indicators', () => {
366362 return navigateToSidebarOption ( 0 ) ;
367363 } )
368364 . then ( waitForBatchedUpdates )
369- . then ( async ( ) => {
370- await act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
365+ . then ( ( ) => {
366+ act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
371367 // Verify that report we navigated to appears in a "read" state while the original unread report still shows as unread
372368 const hintText = translateLocal ( 'accessibilityHints.chatUserDisplayNames' ) ;
373369 const displayNameTexts = screen . queryAllByLabelText ( hintText , { includeHiddenElements : true } ) ;
@@ -444,7 +440,7 @@ describe('Unread Indicators', () => {
444440 return navigateToSidebarOption ( 0 ) ;
445441 } )
446442 . then ( async ( ) => {
447- await act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
443+ act ( ( ) => ( NativeNavigation as NativeNavigationMock ) . triggerTransitionEnd ( ) ) ;
448444 const newMessageLineIndicatorHintText = translateLocal ( 'accessibilityHints.newMessageLineIndicator' ) ;
449445 const unreadIndicator = screen . queryAllByLabelText ( newMessageLineIndicatorHintText ) ;
450446 expect ( unreadIndicator ) . toHaveLength ( 1 ) ;
0 commit comments