зеркало из https://github.com/mozilla/fxa.git
Merge pull request #7393 from mozilla/hotfix/call-create-routes-correctly
fix(auth-server): Correct checks in createRoutes
This commit is contained in:
Коммит
bfd99f8963
|
@ -21,8 +21,7 @@ const createRoutes = (
|
|||
push: any,
|
||||
mailer: any,
|
||||
profile: any,
|
||||
stripeHelper: StripeHelper,
|
||||
payPalHelper: PayPalHelper
|
||||
stripeHelper: StripeHelper
|
||||
) => {
|
||||
const routes: ServerRoute[] = [];
|
||||
|
||||
|
@ -57,7 +56,7 @@ const createRoutes = (
|
|||
)
|
||||
);
|
||||
}
|
||||
if (stripeHelper && payPalHelper) {
|
||||
if (stripeHelper && config.subscriptions.paypalNvpSigCredentials.enabled) {
|
||||
routes.push(
|
||||
...paypalRoutes(
|
||||
log,
|
||||
|
|
|
@ -20,10 +20,13 @@ const MOCK_SCOPES = ['profile:email', SUBSCRIPTIONS_MANAGEMENT_SCOPE];
|
|||
|
||||
let log, customs, request, payPalHelper;
|
||||
|
||||
function runTest(routePath, requestOptions, ppHelper = null) {
|
||||
function runTest(routePath, requestOptions) {
|
||||
const config = {
|
||||
subscriptions: {
|
||||
enabled: true,
|
||||
paypalNvpSigCredentials: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
const db = mocks.mockDB({
|
||||
|
@ -38,8 +41,7 @@ function runTest(routePath, requestOptions, ppHelper = null) {
|
|||
{}, // push
|
||||
{}, // mailer
|
||||
{}, // profile
|
||||
{}, // stripeHelper
|
||||
ppHelper
|
||||
{} // stripeHelper
|
||||
);
|
||||
const route = getRoute(routes, routePath, requestOptions.method || 'GET');
|
||||
request = mocks.mockRequest(requestOptions);
|
||||
|
|
|
@ -199,6 +199,9 @@ describe('subscriptions stripeRoutes', () => {
|
|||
managementClientId: MOCK_CLIENT_ID,
|
||||
managementTokenTTL: MOCK_TTL,
|
||||
stripeApiKey: 'sk_test_1234',
|
||||
paypalNvpSigCredentials: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -1851,7 +1851,7 @@ describe('email translations', () => {
|
|||
);
|
||||
assert.include(
|
||||
emailConfig.subject,
|
||||
'Добавлена альтернативная электронная почта'
|
||||
'Добавлена дополнительная электронная почта'
|
||||
);
|
||||
// assert.include(emailConfig.html, 'Подсоединить другое устройство');
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче