Skip to content

Commit a073d12

Browse files
committed
Fix: Out-of-pocket and company spend not seen automatically if adding unreported expense
1 parent 0c6a786 commit a073d12

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/actions/IOUTest.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6554,6 +6554,7 @@ describe('actions/IOU', () => {
65546554
let updatedTransaction: OnyxEntry<Transaction>;
65556555
let updatedIOUReportActionOnSelfDMReport: OnyxEntry<ReportAction>;
65566556
let updatedTrackExpenseActionableWhisper: OnyxEntry<ReportAction>;
6557+
let updatedExpenseReport: OnyxEntry<Report>;
65576558

65586559
await getOnyxData({
65596560
key: ONYXKEYS.COLLECTION.TRANSACTION,
@@ -6576,9 +6577,19 @@ describe('actions/IOU', () => {
65766577
},
65776578
});
65786579

6580+
await getOnyxData({
6581+
key: ONYXKEYS.COLLECTION.REPORT,
6582+
waitForCollectionCallback: true,
6583+
callback: (allReports) => {
6584+
updatedExpenseReport = Object.values(allReports ?? {}).find((r) => r?.reportID === expenseReport?.reportID);
6585+
},
6586+
});
6587+
65796588
expect(updatedTransaction?.reportID).toBe(expenseReport?.reportID);
65806589
expect(isMoneyRequestAction(updatedIOUReportActionOnSelfDMReport) ? getOriginalMessage(updatedIOUReportActionOnSelfDMReport)?.IOUTransactionID : undefined).toBe(undefined);
65816590
expect(updatedTrackExpenseActionableWhisper).toBe(undefined);
6591+
expect(updatedExpenseReport?.nonReimbursableTotal).toBeTruthy();
6592+
expect(updatedExpenseReport?.total).toBeTruthy();
65826593
});
65836594

65846595
describe('saveSplitTransactions', () => {

0 commit comments

Comments
 (0)