Skip to content

Commit

Permalink
fix: handle comment suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
allroundexperts committed Oct 22, 2023
1 parent 9c2df99 commit c54734a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/actions/IOUTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ describe('actions/IOU', () => {
});
});

describe('pay iou report via ACH', () => {
describe('pay expense report via ACH', () => {
const amount = 10000;
const comment = '💸💸💸💸';
const merchant = 'NASDAQ';
Expand All @@ -1676,8 +1676,8 @@ describe('actions/IOU', () => {
fetch.resume();
});

it('updates the IOU request and IOU report when paid while offline', () => {
let iouReport = {};
it('updates the expense request and expense report when paid while offline', () => {
let expenseReport = {};
let chatReport = {};

fetch.pause();
Expand Down Expand Up @@ -1714,22 +1714,22 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
iouReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);

resolve();
},
});
}),
)
.then(() => {
IOU.payMoneyRequest(CONST.IOU.PAYMENT_TYPE.VBBA, chatReport, iouReport);
IOU.payMoneyRequest(CONST.IOU.PAYMENT_TYPE.VBBA, chatReport, expenseReport);
return waitForBatchedUpdates();
})
.then(
() =>
new Promise((resolve) => {
const connectionID = Onyx.connect({
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.reportID}`,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport.reportID}`,
waitForCollectionCallback: true,
callback: (allActions) => {
Onyx.disconnect(connectionID);
Expand Down Expand Up @@ -1764,7 +1764,7 @@ describe('actions/IOU', () => {
callback: (allReports) => {
Onyx.disconnect(connectionID);
const updatedIOUReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
const updatedChatReport = _.find(allReports, (report) => report.reportID === iouReport.chatReportID);
const updatedChatReport = _.find(allReports, (report) => report.reportID === expenseReport.chatReportID);
expect(updatedIOUReport).toEqual(
expect.objectContaining({
lastMessageHtml: `paid $${amount / 100}.00 with Expensify`,
Expand All @@ -1788,7 +1788,7 @@ describe('actions/IOU', () => {
});

it('shows an error when paying results in an error', () => {
let iouReport = {};
let expenseReport = {};
let chatReport = {};

Onyx.set(ONYXKEYS.SESSION, {email: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID});
Expand Down Expand Up @@ -1824,7 +1824,7 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
iouReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);

resolve();
},
Expand All @@ -1833,14 +1833,14 @@ describe('actions/IOU', () => {
)
.then(() => {
fetch.fail();
IOU.payMoneyRequest('ACH', chatReport, iouReport);
IOU.payMoneyRequest('ACH', chatReport, expenseReport);
return waitForBatchedUpdates();
})
.then(
() =>
new Promise((resolve) => {
const connectionID = Onyx.connect({
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.reportID}`,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport.reportID}`,
waitForCollectionCallback: true,
callback: (allActions) => {
Onyx.disconnect(connectionID);
Expand Down

0 comments on commit c54734a

Please sign in to comment.