Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
waterim committed Oct 17, 2023
1 parent 9b541c1 commit 644aa70
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions tests/actions/IOUTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,17 @@ describe('actions/IOU', () => {
}),
)
.then(() => {
IOU.requestMoney(chatReport, amount, CONST.CURRENCY.USD, '', merchant, RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment);
IOU.requestMoney(
chatReport,
amount,
CONST.CURRENCY.USD,
'',
merchant,
RORY_EMAIL,
RORY_ACCOUNT_ID,
{login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID},
comment,
);
return waitForBatchedUpdates();
})
.then(
Expand All @@ -2199,7 +2209,7 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.EXPENSE);
Onyx.merge(`report_${expenseReport.reportID}`, {
statusNum: 0,
stateNum: 0,
Expand All @@ -2217,7 +2227,8 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.EXPENSE);

// Verify report is a draft
expect(expenseReport.stateNum).toBe(0);
expect(expenseReport.statusNum).toBe(0);
Expand All @@ -2238,7 +2249,8 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.EXPENSE);

// Report was submitted correctly
expect(expenseReport.stateNum).toBe(1);
expect(expenseReport.statusNum).toBe(1);
Expand Down Expand Up @@ -2275,7 +2287,17 @@ describe('actions/IOU', () => {
}),
)
.then(() => {
IOU.requestMoney(chatReport, amount, CONST.CURRENCY.USD, '', merchant, RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment);
IOU.requestMoney(
chatReport,
amount,
CONST.CURRENCY.USD,
'',
merchant,
RORY_EMAIL,
RORY_ACCOUNT_ID,
{login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID},
comment,
);
return waitForBatchedUpdates();
})
.then(
Expand All @@ -2286,7 +2308,7 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.EXPENSE);
Onyx.merge(`report_${expenseReport.reportID}`, {
statusNum: 0,
stateNum: 0,
Expand All @@ -2304,7 +2326,8 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.EXPENSE);

// Verify report is a draft
expect(expenseReport.stateNum).toBe(0);
expect(expenseReport.statusNum).toBe(0);
Expand All @@ -2326,7 +2349,8 @@ describe('actions/IOU', () => {
waitForCollectionCallback: true,
callback: (allReports) => {
Onyx.disconnect(connectionID);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU);
expenseReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.EXPENSE);

// Report was submitted with some fail
expect(expenseReport.stateNum).toBe(0);
expect(expenseReport.statusNum).toBe(0);
Expand Down

0 comments on commit 644aa70

Please sign in to comment.