Skip to content

Commit

Permalink
fix: add test for cancel payment
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Nov 28, 2024
1 parent b3d6e40 commit 36bb786
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/actions/IOUTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,28 @@ describe('actions/IOU', () => {
);
expect(payIOUAction).toBeTruthy();

resolve();
},
});
}),
)
.then(() => {
mockFetch?.pause?.();
if (chatReport && iouReport) {
IOU.cancelPayment(iouReport, chatReport);
}
return waitForBatchedUpdates();
})
.then(
() =>
new Promise<void>((resolve) => {
const connection = Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connection);
const chatReportData = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${chatReport?.reportID}`];
expect(chatReportData?.iouReportID).toBe(iouReport?.reportID);
resolve();
},
});
Expand Down

0 comments on commit 36bb786

Please sign in to comment.