Revert "moving developer-only strings to api messages (#10188)"

This reverts commit a42cb0e3ab. Testing hypothesis that this was causing Staging to break.
This commit is contained in:
SabreCat
2018-04-15 17:09:15 +00:00
parent ac98aa9271
commit 9f06d78db6
55 changed files with 136 additions and 179 deletions
@@ -1,8 +1,8 @@
import {
generateUser,
translate as t,
} from '../../../../../helpers/api-integration/v3';
import paypalPayments from '../../../../../../website/server/libs/payments/paypal';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
describe('payments : paypal #checkoutSuccess', () => {
let endpoint = '/paypal/checkout/success';
@@ -17,7 +17,7 @@ describe('payments : paypal #checkoutSuccess', () => {
.to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: apiMessages('missingPaymentId'),
message: t('missingPaymentId'),
});
});
@@ -26,7 +26,7 @@ describe('payments : paypal #checkoutSuccess', () => {
.to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: apiMessages('missingCustomerId'),
message: t('missingCustomerId'),
});
});
@@ -1,9 +1,9 @@
import {
generateUser,
translate as t,
} from '../../../../../helpers/api-integration/v3';
import paypalPayments from '../../../../../../website/server/libs/payments/paypal';
import shared from '../../../../../../website/common';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
describe('payments : paypal #subscribe', () => {
let endpoint = '/paypal/subscribe';
@@ -17,7 +17,7 @@ describe('payments : paypal #subscribe', () => {
await expect(user.get(endpoint)).to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: apiMessages('missingSubKey'),
message: t('missingSubKey'),
});
});
@@ -1,7 +1,7 @@
import {
generateUser,
translate as t,
} from '../../../../../helpers/api-integration/v3';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
import paypalPayments from '../../../../../../website/server/libs/payments/paypal';
describe('payments : paypal #subscribeSuccess', () => {
@@ -16,7 +16,7 @@ describe('payments : paypal #subscribeSuccess', () => {
await expect(user.get(endpoint)).to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: apiMessages('missingPaypalBlock'),
message: t('missingPaypalBlock'),
});
});
@@ -5,7 +5,6 @@ import {
} from '../../../../helpers/api-v3-integration.helper';
import { v4 as generateUUID } from 'uuid';
import { quests as questScrolls } from '../../../../../website/common/script/content';
import apiMessages from '../../../../../website/server/libs/apiMessages';
describe('POST /groups/:groupId/quests/invite/:questKey', () => {
let questingGroup;
@@ -69,7 +68,7 @@ describe('POST /groups/:groupId/quests/invite/:questKey', () => {
await expect(leader.post(`/groups/${questingGroup._id}/quests/invite/${FAKE_QUEST}`)).to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: apiMessages('questNotFound', {key: FAKE_QUEST}),
message: t('questNotFound', {key: FAKE_QUEST}),
});
});
@@ -9,7 +9,6 @@ import {
import { v4 as generateUUID } from 'uuid';
import { find } from 'lodash';
import apiMessages from '../../../../../website/server/libs/apiMessages';
describe('POST /user/class/cast/:spellId', () => {
let user;
@@ -25,7 +24,7 @@ describe('POST /user/class/cast/:spellId', () => {
.to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: apiMessages('spellNotFound', {spellId}),
message: t('spellNotFound', {spellId}),
});
});
@@ -35,7 +34,7 @@ describe('POST /user/class/cast/:spellId', () => {
.to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: apiMessages('spellNotFound', {spellId}),
message: t('spellNotFound', {spellId}),
});
});
@@ -5,7 +5,6 @@ import {
translate as t,
} from '../../../../../helpers/api-integration/v3';
import shared from '../../../../../../website/common/script';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
let content = shared.content;
@@ -25,7 +24,7 @@ describe('POST /user/buy/:key', () => {
.to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: apiMessages('itemNotFound', {key: 'notExisting'}),
message: t('itemNotFound', {key: 'notExisting'}),
});
});
@@ -2,8 +2,8 @@
import {
generateUser,
translate as t,
} from '../../../../../helpers/api-integration/v3';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
describe('POST /user/buy-gear/:key', () => {
let user;
@@ -21,7 +21,7 @@ describe('POST /user/buy-gear/:key', () => {
.to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: apiMessages('itemNotFound', {key: 'notExisting'}),
message: t('itemNotFound', {key: 'notExisting'}),
});
});
@@ -3,7 +3,6 @@ import {
translate as t,
} from '../../../../../helpers/api-integration/v3';
import shared from '../../../../../../website/common/script';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
let content = shared.content;
@@ -21,7 +20,7 @@ describe('POST /user/buy-quest/:key', () => {
.to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: apiMessages('questNotFound', {key: 'notExisting'}),
message: t('questNotFound', {key: 'notExisting'}),
});
});
@@ -3,7 +3,6 @@ import {
translate as t,
} from '../../../../../helpers/api-integration/v3';
import shared from '../../../../../../website/common/script';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
let content = shared.content;
@@ -21,7 +20,7 @@ describe('POST /user/buy-special-spell/:key', () => {
.to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: apiMessages('spellNotFound', {spellId: 'notExisting'}),
message: t('spellNotFound', {spellId: 'notExisting'}),
});
});
@@ -2,7 +2,6 @@ import {
generateUser,
translate as t,
} from '../../../../../helpers/api-integration/v3';
import apiMessages from '../../../../../../website/server/libs/apiMessages';
describe('POST /user/allocate', () => {
let user;
@@ -18,7 +17,7 @@ describe('POST /user/allocate', () => {
.to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: apiMessages('invalidAttribute', {attr: 'invalid'}),
message: t('invalidAttribute', {attr: 'invalid'}),
});
});
@@ -3,7 +3,6 @@ import {
translate as t,
} from '../../../../helpers/api-integration/v3';
import { v4 as generateUUID } from 'uuid';
import apiMessages from '../../../../../website/server/libs/apiMessages';
describe('POST /user/webhook', () => {
let user, body;
@@ -201,7 +200,7 @@ describe('POST /user/webhook', () => {
await expect(user.post('/user/webhook', body)).to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: apiMessages('groupIdRequired'),
message: t('groupIdRequired'),
});
});
@@ -3,7 +3,6 @@ import {
translate as t,
} from '../../../../helpers/api-integration/v3';
import { v4 as generateUUID} from 'uuid';
import apiMessages from '../../../../../website/server/libs/apiMessages';
describe('PUT /user/webhook/:id', () => {
let user, webhookToUpdate;
@@ -127,7 +126,7 @@ describe('PUT /user/webhook/:id', () => {
await expect(user.put(`/user/webhook/${webhookToUpdate.id}`, {type, options})).to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: apiMessages('groupIdRequired'),
message: t('groupIdRequired'),
});
});
});