@@ -7,6 +7,7 @@ import {bulkDuplicateExpenses, duplicateExpenseTransaction, duplicateReport, mer
77import type { DuplicateReportParams } from '@libs/actions/IOU/Duplicate' ;
88import initOnyxDerivedValues from '@libs/actions/OnyxDerived' ;
99import { addComment , openReport } from '@libs/actions/Report' ;
10+ import type { MergeDuplicatesParams } from '@libs/API/parameters' ;
1011import { WRITE_COMMANDS } from '@libs/API/types' ;
1112import Navigation from '@libs/Navigation/Navigation' ;
1213import { getLoginsByAccountIDs } from '@libs/PersonalDetailsUtils' ;
@@ -186,7 +187,7 @@ describe('actions/Duplicate', () => {
186187 await Onyx . set ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ childReportID } ` , { } ) ;
187188 await waitForBatchedUpdates ( ) ;
188189
189- const mergeParams = {
190+ const mergeParams : MergeDuplicatesParams = {
190191 transactionID : mainTransactionID ,
191192 transactionIDList : duplicateTransactionIDs ,
192193 created : '2024-01-01 12:00:00' ,
@@ -200,12 +201,10 @@ describe('actions/Duplicate', () => {
200201 tag : 'UpdatedProject' ,
201202 receiptID : 123 ,
202203 reportID,
203- currentUserLogin : RORY_EMAIL ,
204- currentUserAccountID : RORY_ACCOUNT_ID ,
205204 } ;
206205
207206 // When: Call mergeDuplicates
208- mergeDuplicates ( mergeParams ) ;
207+ mergeDuplicates ( { ... mergeParams , currentUserLogin : RORY_EMAIL , currentUserAccountID : RORY_ACCOUNT_ID } ) ;
209208 await waitForBatchedUpdates ( ) ;
210209
211210 // Then: Verify main transaction was updated
@@ -269,7 +268,7 @@ describe('actions/Duplicate', () => {
269268 await Onyx . set ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ reportID } ` , { } ) ;
270269 await waitForBatchedUpdates ( ) ;
271270
272- const mergeParams = {
271+ const mergeParams : MergeDuplicatesParams = {
273272 transactionID : mainTransactionID ,
274273 transactionIDList : [ ] ,
275274 created : '2024-01-01 12:00:00' ,
@@ -283,12 +282,10 @@ describe('actions/Duplicate', () => {
283282 tag : 'UpdatedProject' ,
284283 receiptID : 123 ,
285284 reportID,
286- currentUserLogin : RORY_EMAIL ,
287- currentUserAccountID : RORY_ACCOUNT_ID ,
288285 } ;
289286
290287 // When: Call mergeDuplicates with empty duplicate list
291- mergeDuplicates ( mergeParams ) ;
288+ mergeDuplicates ( { ... mergeParams , currentUserLogin : RORY_EMAIL , currentUserAccountID : RORY_ACCOUNT_ID } ) ;
292289 await waitForBatchedUpdates ( ) ;
293290
294291 // Then: Verify main transaction was still updated
@@ -322,7 +319,7 @@ describe('actions/Duplicate', () => {
322319 await Onyx . set ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ reportID } ` , { } ) ;
323320 await waitForBatchedUpdates ( ) ;
324321
325- const mergeParams = {
322+ const mergeParams : MergeDuplicatesParams = {
326323 transactionID : mainTransactionID ,
327324 transactionIDList : duplicateTransactionIDs ,
328325 created : '2024-01-01 12:00:00' ,
@@ -336,12 +333,10 @@ describe('actions/Duplicate', () => {
336333 tag : 'UpdatedProject' ,
337334 receiptID : 123 ,
338335 reportID,
339- currentUserLogin : RORY_EMAIL ,
340- currentUserAccountID : RORY_ACCOUNT_ID ,
341336 } ;
342337
343338 // When: Call mergeDuplicates without expense report
344- mergeDuplicates ( mergeParams ) ;
339+ mergeDuplicates ( { ... mergeParams , currentUserLogin : RORY_EMAIL , currentUserAccountID : RORY_ACCOUNT_ID } ) ;
345340 await waitForBatchedUpdates ( ) ;
346341
347342 // Then: Verify function completed without errors
@@ -525,7 +520,7 @@ describe('actions/Duplicate', () => {
525520
526521 await waitForBatchedUpdates ( ) ;
527522
528- const mergeParams = {
523+ const mergeParams : MergeDuplicatesParams = {
529524 transactionID : mainTransactionID ,
530525 transactionIDList : duplicateTransactionIDs ,
531526 created : '2024-01-01 12:00:00' ,
@@ -539,12 +534,10 @@ describe('actions/Duplicate', () => {
539534 tag : 'UpdatedProject' ,
540535 receiptID : 123 ,
541536 reportID,
542- currentUserLogin : RORY_EMAIL ,
543- currentUserAccountID : RORY_ACCOUNT_ID ,
544537 } ;
545538
546539 // When: Call mergeDuplicates
547- mergeDuplicates ( mergeParams ) ;
540+ mergeDuplicates ( { ... mergeParams , currentUserLogin : RORY_EMAIL , currentUserAccountID : RORY_ACCOUNT_ID } ) ;
548541 await waitForBatchedUpdates ( ) ;
549542
550543 // Then we expect the reportPreview to update with new childVisibleActionCount
@@ -626,7 +619,7 @@ describe('actions/Duplicate', () => {
626619 } ) ;
627620 await waitForBatchedUpdates ( ) ;
628621
629- const mergeParams = {
622+ const mergeParams : MergeDuplicatesParams = {
630623 transactionID : mainTransactionID ,
631624 transactionIDList : duplicateTransactionIDs ,
632625 transactionThreadReportID : optimisticTransactionThreadReportID ,
@@ -641,12 +634,10 @@ describe('actions/Duplicate', () => {
641634 tag : 'UpdatedProject' ,
642635 receiptID : 123 ,
643636 reportID,
644- currentUserLogin : RORY_EMAIL ,
645- currentUserAccountID : RORY_ACCOUNT_ID ,
646637 } ;
647638
648639 // When: Call mergeDuplicates with transactionThreadReportID
649- mergeDuplicates ( mergeParams ) ;
640+ mergeDuplicates ( { ... mergeParams , currentUserLogin : RORY_EMAIL , currentUserAccountID : RORY_ACCOUNT_ID } ) ;
650641 await waitForBatchedUpdates ( ) ;
651642
652643 // Then: Verify the optimistic transaction thread report was created
0 commit comments