@@ -735,56 +735,55 @@ describe('DebugUtils', () => {
735735 Onyx . clear ( ) ;
736736 } ) ;
737737 it ( 'returns null when report is not defined' , ( ) => {
738- const reason = DebugUtils . getReasonForShowingRowInLHN ( undefined , chatReportR14932 ) ;
738+ const reason = DebugUtils . getReasonForShowingRowInLHN ( { report : undefined , chatReport : chatReportR14932 } ) ;
739739 expect ( reason ) . toBeNull ( ) ;
740740 } ) ;
741741 it ( 'returns correct reason when report has a valid draft comment' , async ( ) => {
742742 await Onyx . set ( `${ ONYXKEYS . COLLECTION . REPORT_DRAFT_COMMENT } 1` , 'Hello world!' ) ;
743- const reason = DebugUtils . getReasonForShowingRowInLHN ( baseReport , chatReportR14932 ) ;
743+ const reason = DebugUtils . getReasonForShowingRowInLHN ( { report : baseReport , chatReport : chatReportR14932 } ) ;
744744 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.hasDraftComment' ) ;
745745 } ) ;
746746 it ( 'returns correct reason when report has GBR' , ( ) => {
747- const reason = DebugUtils . getReasonForShowingRowInLHN (
748- {
747+ const reason = DebugUtils . getReasonForShowingRowInLHN ( {
748+ report : {
749749 ...baseReport ,
750750 lastMentionedTime : '2024-08-10 18:70:44.171' ,
751751 lastReadTime : '2024-08-08 18:70:44.171' ,
752752 } ,
753- chatReportR14932 ,
754- ) ;
753+ chatReport : chatReportR14932 ,
754+ } ) ;
755755 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.hasGBR' ) ;
756756 } ) ;
757757 it ( 'returns correct reason when report is pinned' , ( ) => {
758- const reason = DebugUtils . getReasonForShowingRowInLHN (
759- {
758+ const reason = DebugUtils . getReasonForShowingRowInLHN ( {
759+ report : {
760760 ...baseReport ,
761761 isPinned : true ,
762762 } ,
763- chatReportR14932 ,
764- ) ;
763+ chatReport : chatReportR14932 ,
764+ } ) ;
765765 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.pinnedByUser' ) ;
766766 } ) ;
767767 it ( 'returns correct reason when report has add workspace room errors' , ( ) => {
768- const reason = DebugUtils . getReasonForShowingRowInLHN (
769- {
768+ const reason = DebugUtils . getReasonForShowingRowInLHN ( {
769+ report : {
770770 ...baseReport ,
771771 errorFields : {
772772 addWorkspaceRoom : {
773773 error : 'Something happened' ,
774774 } ,
775775 } ,
776776 } ,
777- chatReportR14932 ,
778- ) ;
777+ chatReport : chatReportR14932 ,
778+ } ) ;
779779 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.hasAddWorkspaceRoomErrors' ) ;
780780 } ) ;
781781 it ( 'returns correct reason when report is unread' , async ( ) => {
782- await Onyx . set ( ONYXKEYS . NVP_PRIORITY_MODE , CONST . PRIORITY_MODE . GSD ) ;
783782 await Onyx . set ( ONYXKEYS . SESSION , {
784783 accountID : 1234 ,
785784 } ) ;
786- const reason = DebugUtils . getReasonForShowingRowInLHN (
787- {
785+ const reason = DebugUtils . getReasonForShowingRowInLHN ( {
786+ report : {
788787 ...baseReport ,
789788 participants : {
790789 // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -796,39 +795,42 @@ describe('DebugUtils', () => {
796795 lastReadTime : '2024-08-08 18:70:44.171' ,
797796 lastMessageText : 'Hello world!' ,
798797 } ,
799- chatReportR14932 ,
800- ) ;
798+ chatReport : chatReportR14932 ,
799+ isInFocusMode : true ,
800+ } ) ;
801801 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.isUnread' ) ;
802802 } ) ;
803803 it ( 'returns correct reason when report is archived' , async ( ) => {
804804 const reportNameValuePairs = {
805805 private_isArchived : DateUtils . getDBTime ( ) ,
806806 } ;
807- await Onyx . set ( ONYXKEYS . NVP_PRIORITY_MODE , CONST . PRIORITY_MODE . DEFAULT ) ;
808807 await Onyx . set ( `${ ONYXKEYS . COLLECTION . REPORT_NAME_VALUE_PAIRS } ${ baseReport . reportID } ` , reportNameValuePairs ) ;
809808 const { result : isReportArchived } = renderHook ( ( ) => useReportIsArchived ( baseReport ?. reportID ) ) ;
810- const reason = DebugUtils . getReasonForShowingRowInLHN (
811- {
809+ const reason = DebugUtils . getReasonForShowingRowInLHN ( {
810+ report : {
812811 ...baseReport ,
813812 } ,
814- chatReportR14932 ,
815- false ,
816- isReportArchived . current ,
817- ) ;
813+ chatReport : chatReportR14932 ,
814+ hasRBR : false ,
815+ isReportArchived : isReportArchived . current ,
816+ } ) ;
818817 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.isArchived' ) ;
819818 } ) ;
820819 it ( 'returns correct reason when report is self DM' , ( ) => {
821- const reason = DebugUtils . getReasonForShowingRowInLHN (
822- {
820+ const reason = DebugUtils . getReasonForShowingRowInLHN ( {
821+ report : {
823822 ...baseReport ,
824823 chatType : CONST . REPORT . CHAT_TYPE . SELF_DM ,
825824 } ,
826- chatReportR14932 ,
827- ) ;
825+ chatReport : chatReportR14932 ,
826+ } ) ;
828827 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.isSelfDM' ) ;
829828 } ) ;
830829 it ( 'returns correct reason when report is temporarily focused' , ( ) => {
831- const reason = DebugUtils . getReasonForShowingRowInLHN ( baseReport , chatReportR14932 ) ;
830+ const reason = DebugUtils . getReasonForShowingRowInLHN ( {
831+ report : baseReport ,
832+ chatReport : chatReportR14932 ,
833+ } ) ;
832834 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.isFocused' ) ;
833835 } ) ;
834836 it ( 'returns correct reason when report has one transaction thread with violations' , async ( ) => {
@@ -886,7 +888,7 @@ describe('DebugUtils', () => {
886888 } ,
887889 ] ,
888890 } ) ;
889- const reason = DebugUtils . getReasonForShowingRowInLHN ( MOCK_TRANSACTION_REPORT , chatReportR14932 , true ) ;
891+ const reason = DebugUtils . getReasonForShowingRowInLHN ( { report : MOCK_TRANSACTION_REPORT , chatReport : chatReportR14932 , hasRBR : true } ) ;
890892 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.hasRBR' ) ;
891893 } ) ;
892894 it ( 'returns correct reason when report has violations' , async ( ) => {
@@ -944,11 +946,11 @@ describe('DebugUtils', () => {
944946 } ,
945947 ] ,
946948 } ) ;
947- const reason = DebugUtils . getReasonForShowingRowInLHN ( MOCK_EXPENSE_REPORT , chatReportR14932 , true ) ;
949+ const reason = DebugUtils . getReasonForShowingRowInLHN ( { report : MOCK_EXPENSE_REPORT , chatReport : chatReportR14932 , hasRBR : true } ) ;
948950 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.hasRBR' ) ;
949951 } ) ;
950952 it ( 'returns correct reason when report has errors' , ( ) => {
951- const reason = DebugUtils . getReasonForShowingRowInLHN ( baseReport , chatReportR14932 , true ) ;
953+ const reason = DebugUtils . getReasonForShowingRowInLHN ( { report : baseReport , chatReport : chatReportR14932 , hasRBR : true } ) ;
952954 expect ( reason ) . toBe ( 'debug.reasonVisibleInLHN.hasRBR' ) ;
953955 } ) ;
954956 } ) ;
0 commit comments