@@ -99,7 +99,6 @@ function buildParams(overrides: Partial<HookParams> = {}): HookParams {
9999 reportScrollManager,
100100 setIsFloatingMessageCounterVisible : jest . fn ( ) ,
101101 setActionIdToHighlight : jest . fn ( ) ,
102- markNewestActionAsRead : jest . fn ( ) ,
103102 unreadMarkerReportActionID : null ,
104103 hasNewerActions : true ,
105104 linkedReportActionID : undefined ,
@@ -214,9 +213,8 @@ describe('useReportActionsNewActionLiveTail', () => {
214213 it ( 'scrolls straight to the bottom when an unread marker is set but the newest actions are already loaded' , ( ) => {
215214 // Given a report scrolled up with an unread marker from another user's comment, and the newest actions already loaded
216215 const setIsFloatingMessageCounterVisible = jest . fn ( ) ;
217- const markNewestActionAsRead = jest . fn ( ) ;
218216 const { result} = renderHook ( ( props : HookParams ) => useReportActionsNewActionLiveTail ( props ) , {
219- initialProps : buildParams ( { unreadMarkerReportActionID : '2' , hasNewerActions : false , hasNewestReportAction : true , setIsFloatingMessageCounterVisible, markNewestActionAsRead } ) ,
217+ initialProps : buildParams ( { unreadMarkerReportActionID : '2' , hasNewerActions : false , hasNewestReportAction : true , setIsFloatingMessageCounterVisible} ) ,
220218 } ) ;
221219
222220 // When the current user sends a comment
@@ -229,31 +227,6 @@ describe('useReportActionsNewActionLiveTail', () => {
229227 expect ( setIsFloatingMessageCounterVisible ) . toHaveBeenCalledWith ( false ) ;
230228 expect ( reportScrollManager . scrollToBottom ) . toHaveBeenCalledTimes ( 1 ) ;
231229 expect ( result . current . isScrollToBottomEnabled ) . toBe ( true ) ;
232-
233- // And the report is marked as read, so the "New" divider clears and the pill doesn't come back
234- expect ( markNewestActionAsRead ) . toHaveBeenCalledTimes ( 1 ) ;
235- } ) ;
236-
237- it ( 'marks the report as read once openReport has loaded the newest actions after the user sends a comment' , ( ) => {
238- // Given a report whose newest actions are not loaded yet
239- const markNewestActionAsRead = jest . fn ( ) ;
240- const { rerender} = renderHook ( ( props : HookParams ) => useReportActionsNewActionLiveTail ( props ) , { initialProps : buildParams ( { markNewestActionAsRead} ) } ) ;
241-
242- // When the current user sends a comment, which starts the live-tail jump through openReport
243- act ( ( ) => {
244- newActionHandler ?.( true , getFakeReportAction ( 1 , { actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT } ) ) ;
245- } ) ;
246-
247- // Then nothing is marked as read while the newest actions are still loading
248- expect ( mockOpenReport ) . toHaveBeenCalledTimes ( 1 ) ;
249- expect ( markNewestActionAsRead ) . not . toHaveBeenCalled ( ) ;
250-
251- // When openReport finishes and the newest actions arrive
252- rerender ( buildParams ( { markNewestActionAsRead, prevIsLoadingInitialReportActions : true , reportLoadingState : { isLoadingInitialReportActions : false } } ) ) ;
253- rerender ( buildParams ( { markNewestActionAsRead, prevIsLoadingInitialReportActions : false , reportLoadingState : { isLoadingInitialReportActions : false } , hasNewestReportAction : true } ) ) ;
254-
255- // Then the report is marked as read once, alongside hiding the pill
256- expect ( markNewestActionAsRead ) . toHaveBeenCalledTimes ( 1 ) ;
257230 } ) ;
258231
259232 it ( 'still loads the live tail when an unread marker is set and the newest actions are not loaded' , ( ) => {
0 commit comments