@@ -1384,6 +1384,42 @@ describe('ReportActionsUtils', () => {
13841384 } ) ;
13851385 } ) ;
13861386
1387+ describe ( 'shouldReportActionBeVisible' , ( ) => {
1388+ it ( 'should return false for moved transaction if the report destination is unavailable' , ( ) => {
1389+ // Given a moved transaction action but the report destination is not available
1390+ const reportAction : ReportAction < typeof CONST . REPORT . ACTIONS . TYPE . MOVED_TRANSACTION > = {
1391+ actionName : CONST . REPORT . ACTIONS . TYPE . MOVED_TRANSACTION ,
1392+ reportActionID : '1' ,
1393+ created : '2025-09-29' ,
1394+ originalMessage : {
1395+ toReportID : '2' ,
1396+ } ,
1397+ } ;
1398+
1399+ // Then the action should not be visible
1400+ const actual = ReportActionsUtils . shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , true ) ;
1401+ expect ( actual ) . toBe ( false ) ;
1402+ } ) ;
1403+
1404+ it ( 'should return true for moved transaction if the report destination is available' , async ( ) => {
1405+ // Given a moved transaction action but the report destination is available
1406+ const report : Report = createRandomReport ( 2 ) ;
1407+ await Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report . reportID } ` , report ) ;
1408+ const reportAction : ReportAction < typeof CONST . REPORT . ACTIONS . TYPE . MOVED_TRANSACTION > = {
1409+ actionName : CONST . REPORT . ACTIONS . TYPE . MOVED_TRANSACTION ,
1410+ reportActionID : '1' ,
1411+ created : '2025-09-29' ,
1412+ originalMessage : {
1413+ toReportID : report . reportID ,
1414+ } ,
1415+ } ;
1416+
1417+ // Then the action should be visible
1418+ const actual = ReportActionsUtils . shouldReportActionBeVisible ( reportAction , reportAction . reportActionID , true ) ;
1419+ expect ( actual ) . toBe ( true ) ;
1420+ } ) ;
1421+ } ) ;
1422+
13871423 describe ( 'getPolicyChangeLogUpdateEmployee' , ( ) => {
13881424 it ( 'should remove SMS domain when the email is a phone number' , ( ) => {
13891425 const email = '+919383833920@expensify.sms' ;
0 commit comments