@@ -124,6 +124,9 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
124124 let thread : OptimisticChatReport ;
125125 const TEST_USER_ACCOUNT_ID = 1 ;
126126 const TEST_USER_LOGIN = 'test@test.com' ;
127+ const expectedTransactionThreadParticipants = {
128+ [ TEST_USER_ACCOUNT_ID ] : { notificationPreference : CONST . REPORT . NOTIFICATION_PREFERENCE . HIDDEN , role : CONST . REPORT . ROLE . ADMIN } ,
129+ } ;
127130 let IOU_REPORT_ID : string | undefined ;
128131 let IOU_REPORT : OnyxEntry < Report > ;
129132 let reportActionID ;
@@ -243,6 +246,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
243246 ) ;
244247 expect ( createIOUAction ) . toBeTruthy ( ) ;
245248 expect ( createIOUAction && getOriginalMessage ( createIOUAction ) ?. IOUReportID ) . toBe ( iouReport ?. reportID ) ;
249+ thread = ( await getOnyxValue ( `${ ONYXKEYS . COLLECTION . REPORT } ${ createIOUAction ?. childReportID } ` ) ) as OptimisticChatReport ;
246250
247251 // When fetching all transactions from Onyx
248252 let allTransactions : OnyxCollection < Transaction > ;
@@ -277,6 +281,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
277281 violations : { } ,
278282 iouReport,
279283 chatReport,
284+ transactionThreadReport : thread ,
280285 isChatIOUReportArchived : true ,
281286 allTransactionViolationsParam : { } ,
282287 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
@@ -367,6 +372,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
367372 violations : { } ,
368373 iouReport,
369374 chatReport,
375+ transactionThreadReport : thread ,
370376 isChatIOUReportArchived : true ,
371377 allTransactionViolationsParam : { } ,
372378 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
@@ -451,6 +457,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
451457 violations : { } ,
452458 iouReport,
453459 chatReport,
460+ transactionThreadReport : thread ,
454461 allTransactionViolationsParam : { } ,
455462 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
456463 currentUserEmail : TEST_USER_LOGIN ,
@@ -505,7 +512,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
505512 // Given a transaction thread
506513 thread = buildTransactionThread ( createIOUAction , iouReport , TEST_USER_ACCOUNT_ID ) ;
507514
508- expect ( thread . participants ) . toStrictEqual ( { [ CARLOS_ACCOUNT_ID ] : { notificationPreference : CONST . REPORT . NOTIFICATION_PREFERENCE . HIDDEN , role : CONST . REPORT . ROLE . ADMIN } } ) ;
515+ expect ( thread . participants ) . toStrictEqual ( expectedTransactionThreadParticipants ) ;
509516
510517 Onyx . connect ( {
511518 key : `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ thread . reportID } ` ,
@@ -568,6 +575,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
568575 violations : { } ,
569576 iouReport,
570577 chatReport,
578+ transactionThreadReport : thread ,
571579 allTransactionViolationsParam : { } ,
572580 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
573581 currentUserEmail : TEST_USER_LOGIN ,
@@ -723,6 +731,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
723731 violations : { } ,
724732 iouReport,
725733 chatReport,
734+ transactionThreadReport : thread ,
726735 allTransactionViolationsParam : { } ,
727736 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
728737 currentUserEmail : TEST_USER_LOGIN ,
@@ -752,7 +761,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
752761 // Given a transaction thread
753762 thread = buildTransactionThread ( createIOUAction , iouReport , TEST_USER_ACCOUNT_ID ) ;
754763
755- expect ( thread . participants ) . toEqual ( { [ CARLOS_ACCOUNT_ID ] : { notificationPreference : CONST . REPORT . NOTIFICATION_PREFERENCE . HIDDEN , role : CONST . REPORT . ROLE . ADMIN } } ) ;
764+ expect ( thread . participants ) . toEqual ( expectedTransactionThreadParticipants ) ;
756765
757766 const participantAccountIDs = Object . keys ( thread . participants ?? { } ) . map ( Number ) ;
758767 const userLogins = getLoginsByAccountIDs ( participantAccountIDs ) ;
@@ -844,6 +853,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
844853 violations : { } ,
845854 iouReport,
846855 chatReport,
856+ transactionThreadReport : thread ,
847857 allTransactionViolationsParam : { } ,
848858 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
849859 currentUserEmail : TEST_USER_LOGIN ,
@@ -891,7 +901,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
891901 jest . advanceTimersByTime ( 10 ) ;
892902 thread = buildTransactionThread ( createIOUAction , iouReport , TEST_USER_ACCOUNT_ID ) ;
893903
894- expect ( thread . participants ) . toStrictEqual ( { [ CARLOS_ACCOUNT_ID ] : { notificationPreference : CONST . REPORT . NOTIFICATION_PREFERENCE . HIDDEN , role : CONST . REPORT . ROLE . ADMIN } } ) ;
904+ expect ( thread . participants ) . toStrictEqual ( expectedTransactionThreadParticipants ) ;
895905
896906 Onyx . connect ( {
897907 key : `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ thread . reportID } ` ,
@@ -1038,6 +1048,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
10381048 violations : { } ,
10391049 iouReport,
10401050 chatReport,
1051+ transactionThreadReport : thread ,
10411052 isChatIOUReportArchived : undefined ,
10421053 allTransactionViolationsParam : { } ,
10431054 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
@@ -1152,6 +1163,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
11521163 violations : { } ,
11531164 iouReport,
11541165 chatReport,
1166+ transactionThreadReport : thread ,
11551167 isChatIOUReportArchived : undefined ,
11561168 allTransactionViolationsParam : { } ,
11571169 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
@@ -1213,7 +1225,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
12131225 jest . advanceTimersByTime ( 10 ) ;
12141226 thread = buildTransactionThread ( createIOUAction , iouReport , TEST_USER_ACCOUNT_ID ) ;
12151227
1216- expect ( thread . participants ) . toStrictEqual ( { [ CARLOS_ACCOUNT_ID ] : { notificationPreference : CONST . REPORT . NOTIFICATION_PREFERENCE . HIDDEN , role : CONST . REPORT . ROLE . ADMIN } } ) ;
1228+ expect ( thread . participants ) . toStrictEqual ( expectedTransactionThreadParticipants ) ;
12171229
12181230 jest . advanceTimersByTime ( 10 ) ;
12191231 const participantAccountIDs = Object . keys ( thread . participants ?? { } ) . map ( Number ) ;
@@ -1263,6 +1275,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
12631275 violations : { } ,
12641276 iouReport,
12651277 chatReport,
1278+ transactionThreadReport : thread ,
12661279 isSingleTransactionView : true ,
12671280 allTransactionViolationsParam : { } ,
12681281 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
@@ -1322,6 +1335,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
13221335 violations : { } ,
13231336 iouReport,
13241337 chatReport,
1338+ transactionThreadReport : thread ,
13251339 allTransactionViolationsParam : { } ,
13261340 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
13271341 currentUserEmail : TEST_USER_LOGIN ,
@@ -1393,7 +1407,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
13931407 // Given a transaction thread
13941408 thread = buildTransactionThread ( createIOUAction , iouReport , TEST_USER_ACCOUNT_ID ) ;
13951409
1396- expect ( thread . participants ) . toEqual ( { [ CARLOS_ACCOUNT_ID ] : { notificationPreference : CONST . REPORT . NOTIFICATION_PREFERENCE . HIDDEN , role : CONST . REPORT . ROLE . ADMIN } } ) ;
1410+ expect ( thread . participants ) . toEqual ( expectedTransactionThreadParticipants ) ;
13971411
13981412 const participantAccountIDs = Object . keys ( thread . participants ?? { } ) . map ( Number ) ;
13991413 const userLogins = getLoginsByAccountIDs ( participantAccountIDs ) ;
@@ -1494,6 +1508,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
14941508 violations : { } ,
14951509 iouReport,
14961510 chatReport,
1511+ transactionThreadReport : thread ,
14971512 allTransactionViolationsParam : { } ,
14981513 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
14991514 currentUserEmail : TEST_USER_LOGIN ,
@@ -1584,6 +1599,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
15841599 violations : { } ,
15851600 iouReport : expenseReport ,
15861601 chatReport : expenseReport ,
1602+ transactionThreadReport : undefined ,
15871603 transactionIDsPendingDeletion : [ ] ,
15881604 selectedTransactionIDs,
15891605 allTransactionViolationsParam : { } ,
@@ -1597,6 +1613,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
15971613 violations : { } ,
15981614 iouReport : expenseReport ,
15991615 chatReport : expenseReport ,
1616+ transactionThreadReport : undefined ,
16001617 transactionIDsPendingDeletion : [ transaction1 . transactionID ] ,
16011618 selectedTransactionIDs,
16021619 allTransactionViolationsParam : { } ,
@@ -1676,6 +1693,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
16761693 violations : { } ,
16771694 iouReport : expenseReport ,
16781695 chatReport : expenseReport ,
1696+ transactionThreadReport : undefined ,
16791697 allTransactionViolationsParam : transactionViolations ,
16801698 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
16811699 currentUserEmail : TEST_USER_LOGIN ,
@@ -1740,6 +1758,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => {
17401758 violations : { } ,
17411759 iouReport : expenseReport ,
17421760 chatReport : expenseReport ,
1761+ transactionThreadReport : undefined ,
17431762 allTransactionViolationsParam : { } ,
17441763 currentUserAccountID : TEST_USER_ACCOUNT_ID ,
17451764 currentUserEmail : TEST_USER_LOGIN ,
0 commit comments