mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
v3 payments: fix tests
This commit is contained in:
@@ -175,8 +175,6 @@
|
||||
"resetComplete": "Reset completed",
|
||||
"lvl10ChangeClass": "To change class you must be at least level 10.",
|
||||
"equipmentAlreadyOwned": "You already own that piece of equipment",
|
||||
"missingAccessToken": "The request is missing a required parameter : access_token",
|
||||
"missingBillingAgreementId": "Missing billing agreement id",
|
||||
"paymentNotSuccessful": "The payment was not successful",
|
||||
"planNotActive": "The plan hasn't activated yet (due to a PayPal bug). It will begin <%= nextBillingDate %>, after which you can cancel to retain your full benefits",
|
||||
"cancelingSubscription": "Canceling the subscription"
|
||||
|
||||
@@ -10,13 +10,11 @@ describe('payments - amazon - #checkout', () => {
|
||||
user = await generateUser();
|
||||
});
|
||||
|
||||
it('verifies credentials', async (done) => {
|
||||
try {
|
||||
await user.post(endpoint);
|
||||
} catch (e) {
|
||||
expect(e.error).to.eql('BadRequest');
|
||||
expect(e.message.type).to.eql('InvalidParameterValue');
|
||||
done();
|
||||
}
|
||||
it('verifies credentials', async () => {
|
||||
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
||||
code: 400,
|
||||
error: 'BadRequest',
|
||||
message: 'Missing req.body.orderReferenceId',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
|
||||
describe('payments : amazon', () => {
|
||||
@@ -15,7 +14,7 @@ describe('payments : amazon', () => {
|
||||
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
||||
code: 400,
|
||||
error: 'BadRequest',
|
||||
message: t('missingAccessToken'),
|
||||
message: 'Missing req.body.access_token',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,6 +12,6 @@ describe('payments - paypal - #ipn', () => {
|
||||
|
||||
it('verifies credentials', async () => {
|
||||
let result = await user.post(endpoint);
|
||||
expect(result).to.eql({});
|
||||
expect(result).to.eql('OK');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('payments - stripe - #checkout', () => {
|
||||
});
|
||||
|
||||
it('verifies credentials', async () => {
|
||||
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
||||
await expect(user.post(endpoint, {id: 123})).to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'Error',
|
||||
message: 'Invalid API Key provided: ****************************1111',
|
||||
|
||||
@@ -13,8 +13,8 @@ describe('payments - stripe - #subscribeEdit', () => {
|
||||
|
||||
it('verifies credentials', async () => {
|
||||
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
||||
code: 400,
|
||||
error: 'BadRequest',
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
message: t('missingSubscription'),
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user