Skip to content

Commit

Permalink
fix(test): Fix create recurring payment test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindavee committed Mar 5, 2020
1 parent 08ce922 commit 3f5533c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/recurring/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const AMOUNT = 10000;
const INTERVAL = 'MONTH';
const INTERVAL_COUNT = 1;
const PAYMENT_ID = '5e0577bdf4d38b20d542009b';
const START_DATE = '2020-01-31T17:00:00.000Z';

const PAYMENT_DETAILS = {
id: PAYMENT_ID,
Expand All @@ -14,6 +15,7 @@ const PAYMENT_DETAILS = {
amount: AMOUNT,
interval: INTERVAL,
interval_count: INTERVAL_COUNT,
start_date: START_DATE,
};

const UPDATED_AMOUNT = 20000;
Expand All @@ -30,6 +32,7 @@ module.exports = {
INTERVAL_COUNT,
PAYMENT_ID,
PAYMENT_DETAILS,
START_DATE,
UPDATED_AMOUNT,
UPDATED_PAYMENT_DETAILS,
};
2 changes: 2 additions & 0 deletions test/recurring/manage_payments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = function(x) {
amount: TestConstants.AMOUNT,
interval: TestConstants.INTERVAL,
interval_count: TestConstants.INTERVAL_COUNT,
start_date: TestConstants.START_DATE,
})
.reply(201, TestConstants.PAYMENT_DETAILS);
nock(rp.API_ENDPOINT)
Expand All @@ -44,6 +45,7 @@ module.exports = function(x) {
amount: TestConstants.AMOUNT,
interval: RecurringPayment.Interval.Month,
intervalCount: TestConstants.INTERVAL_COUNT,
startDate: new Date(TestConstants.PAYMENT_DETAILS.start_date),
}),
)
.to.eventually.deep.equal(TestConstants.PAYMENT_DETAILS)
Expand Down

0 comments on commit 3f5533c

Please sign in to comment.