@@ -3838,6 +3838,8 @@ describe('actions/Report', () => {
38383838 } ) ;
38393839
38403840 describe ( 'moveIOUReportToPolicyAndInviteSubmitter' , ( ) => {
3841+ const TEST_USER_ACCOUNT_ID = 1 ;
3842+
38413843 it ( 'should create moved action on the expense report' , async ( ) => {
38423844 const ownerAccountID = 1 ;
38433845 const ownerEmail = 'owner@gmail.com' ;
@@ -3857,7 +3859,7 @@ describe('actions/Report', () => {
38573859 await Onyx . merge ( `${ ONYXKEYS . COLLECTION . POLICY } ${ policy . id } ` , policy ) ;
38583860
38593861 // When moving iou to a workspace and invite the submitter
3860- Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , ( phone : string ) => phone , { } ) ;
3862+ Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , ( phone : string ) => phone , { } , TEST_USER_ACCOUNT_ID ) ;
38613863 await waitForBatchedUpdates ( ) ;
38623864
38633865 // Then MOVED report action should be added to the expense report
@@ -3924,7 +3926,7 @@ describe('actions/Report', () => {
39243926
39253927 // Call moveIOUReportToPolicyAndInviteSubmitter
39263928 const formatPhoneNumber = ( phoneNumber : string ) => phoneNumber ;
3927- Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , formatPhoneNumber , { } ) ;
3929+ Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , formatPhoneNumber , { } , TEST_USER_ACCOUNT_ID ) ;
39283930 await waitForBatchedUpdates ( ) ;
39293931
39303932 // Simulate network failure
@@ -3981,7 +3983,7 @@ describe('actions/Report', () => {
39813983 await Onyx . merge ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ transactionID } ` , transaction ) ;
39823984
39833985 // When moving IOU to a workspace with reportTransactions
3984- Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , ( phone : string ) => phone , { } , [ transaction ] ) ;
3986+ Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , ( phone : string ) => phone , { } , TEST_USER_ACCOUNT_ID , [ transaction ] ) ;
39853987 await waitForBatchedUpdates ( ) ;
39863988
39873989 // Then the transaction amounts should be negated optimistically
@@ -4026,7 +4028,7 @@ describe('actions/Report', () => {
40264028 await Onyx . merge ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ transactionID } ` , transaction ) ;
40274029
40284030 // When moving IOU to a workspace with transactions
4029- Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , ( phone : string ) => phone , { } , [ transaction ] ) ;
4031+ Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , policy , ( phone : string ) => phone , { } , TEST_USER_ACCOUNT_ID , [ transaction ] ) ;
40304032 await waitForBatchedUpdates ( ) ;
40314033
40324034 // Then the report should be converted to an expense report with the new policyID
@@ -4049,13 +4051,13 @@ describe('actions/Report', () => {
40494051 ...createRandomReport ( 1 , undefined ) ,
40504052 type : CONST . REPORT . TYPE . IOU ,
40514053 } ;
4052- const result = Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , undefined as unknown as OnyxTypes . Policy , ( phone : string ) => phone , { } ) ;
4054+ const result = Report . moveIOUReportToPolicyAndInviteSubmitter ( iouReport , undefined as unknown as OnyxTypes . Policy , ( phone : string ) => phone , { } , TEST_USER_ACCOUNT_ID ) ;
40534055 expect ( result ) . toBeUndefined ( ) ;
40544056 } ) ;
40554057
40564058 it ( 'should return undefined when iouReport is missing' , ( ) => {
40574059 const policy : OnyxTypes . Policy = { ...createRandomPolicy ( 1 ) , role : CONST . POLICY . ROLE . ADMIN } ;
4058- const result = Report . moveIOUReportToPolicyAndInviteSubmitter ( undefined , policy , ( phone : string ) => phone , { } ) ;
4060+ const result = Report . moveIOUReportToPolicyAndInviteSubmitter ( undefined , policy , ( phone : string ) => phone , { } , TEST_USER_ACCOUNT_ID ) ;
40594061 expect ( result ) . toBeUndefined ( ) ;
40604062 } ) ;
40614063 } ) ;
0 commit comments