Skip to content

Commit

Permalink
fix unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Sep 29, 2023
1 parent 0584362 commit 3563a7c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/actions/IOUTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ describe('actions/IOU', () => {
let iouAction;
let transactionID;
fetch.pause();
IOU.requestMoney({}, amount, CONST.CURRENCY.USD, '', merchant, RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment);
Onyx.set(ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES, {}).then(() =>
IOU.requestMoney({}, amount, CONST.CURRENCY.USD, '', merchant, RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment),
);

return waitForBatchedUpdates()
.then(
() =>
Expand Down Expand Up @@ -221,6 +224,7 @@ describe('actions/IOU', () => {
[createdAction.reportActionID]: createdAction,
}),
)
.then(() => Onyx.set(ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES, {}))
.then(() => {
IOU.requestMoney(chatReport, amount, CONST.CURRENCY.USD, '', '', RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment);
return waitForBatchedUpdates();
Expand Down Expand Up @@ -413,6 +417,7 @@ describe('actions/IOU', () => {
}),
)
.then(() => Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION}${existingTransaction.transactionID}`, existingTransaction))
.then(() => Onyx.set(ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES, {}))
.then(() => {
IOU.requestMoney(chatReport, amount, CONST.CURRENCY.USD, '', '', RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment);
return waitForBatchedUpdates();
Expand Down Expand Up @@ -547,7 +552,10 @@ describe('actions/IOU', () => {
let iouAction;
let transactionID;
fetch.pause();
IOU.requestMoney({}, amount, CONST.CURRENCY.USD, '', '', RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment);
Onyx.set(ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES, {}).then(() =>
IOU.requestMoney({}, amount, CONST.CURRENCY.USD, '', '', RORY_EMAIL, RORY_ACCOUNT_ID, {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, comment),
);

return (
waitForBatchedUpdates()
.then(
Expand Down Expand Up @@ -901,6 +909,7 @@ describe('actions/IOU', () => {
}),
)
.then(() => Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION}${julesExistingTransaction.transactionID}`, julesExistingTransaction))
.then(() => Onyx.set(ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES, {}))
.then(() => {
// When we split a bill offline
fetch.pause();
Expand Down

0 comments on commit 3563a7c

Please sign in to comment.