mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
v3 payments: fix tests
This commit is contained in:
@@ -175,8 +175,6 @@
|
|||||||
"resetComplete": "Reset completed",
|
"resetComplete": "Reset completed",
|
||||||
"lvl10ChangeClass": "To change class you must be at least level 10.",
|
"lvl10ChangeClass": "To change class you must be at least level 10.",
|
||||||
"equipmentAlreadyOwned": "You already own that piece of equipment",
|
"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",
|
"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",
|
"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"
|
"cancelingSubscription": "Canceling the subscription"
|
||||||
|
|||||||
@@ -10,13 +10,11 @@ describe('payments - amazon - #checkout', () => {
|
|||||||
user = await generateUser();
|
user = await generateUser();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('verifies credentials', async (done) => {
|
it('verifies credentials', async () => {
|
||||||
try {
|
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
||||||
await user.post(endpoint);
|
code: 400,
|
||||||
} catch (e) {
|
error: 'BadRequest',
|
||||||
expect(e.error).to.eql('BadRequest');
|
message: 'Missing req.body.orderReferenceId',
|
||||||
expect(e.message.type).to.eql('InvalidParameterValue');
|
});
|
||||||
done();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
generateUser,
|
generateUser,
|
||||||
translate as t,
|
|
||||||
} from '../../../../helpers/api-integration/v3';
|
} from '../../../../helpers/api-integration/v3';
|
||||||
|
|
||||||
describe('payments : amazon', () => {
|
describe('payments : amazon', () => {
|
||||||
@@ -15,7 +14,7 @@ describe('payments : amazon', () => {
|
|||||||
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
||||||
code: 400,
|
code: 400,
|
||||||
error: 'BadRequest',
|
error: 'BadRequest',
|
||||||
message: t('missingAccessToken'),
|
message: 'Missing req.body.access_token',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ describe('payments - paypal - #ipn', () => {
|
|||||||
|
|
||||||
it('verifies credentials', async () => {
|
it('verifies credentials', async () => {
|
||||||
let result = await user.post(endpoint);
|
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 () => {
|
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,
|
code: 401,
|
||||||
error: 'Error',
|
error: 'Error',
|
||||||
message: 'Invalid API Key provided: ****************************1111',
|
message: 'Invalid API Key provided: ****************************1111',
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ describe('payments - stripe - #subscribeEdit', () => {
|
|||||||
|
|
||||||
it('verifies credentials', async () => {
|
it('verifies credentials', async () => {
|
||||||
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
|
||||||
code: 400,
|
code: 401,
|
||||||
error: 'BadRequest',
|
error: 'NotAuthorized',
|
||||||
message: t('missingSubscription'),
|
message: t('missingSubscription'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user