From b0234dd58ecd53949c94541037f26a1c79e5262a Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Fri, 9 Sep 2022 10:59:17 +0100 Subject: [PATCH] Removed apiVersions from test urlUtils refs: https://github.com/TryGhost/Toolbox/issues/229 - These properties were removed from urlUtils in 5.0 and no longer do anything --- .../unit/server/services/stripe/config.test.js | 14 +++----------- ghost/core/test/utils/urlUtils.js | 2 -- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ghost/core/test/unit/server/services/stripe/config.test.js b/ghost/core/test/unit/server/services/stripe/config.test.js index d1ac38233e..768d5f949c 100644 --- a/ghost/core/test/unit/server/services/stripe/config.test.js +++ b/ghost/core/test/unit/server/services/stripe/config.test.js @@ -20,14 +20,6 @@ function createUrlUtilsMock() { getSubdir: configUtils.config.getSubdir, getSiteUrl: configUtils.config.getSiteUrl, getAdminUrl: configUtils.config.getAdminUrl, - apiVersions: { - all: ['canary'], - canary: { - admin: 'admin', - content: 'content' - } - }, - defaultApiVersion: 'canary', slugs: ['ghost', 'rss', 'amp'], redirectCacheMaxAge: 31536000, baseApiPath: '/ghost/api' @@ -55,7 +47,7 @@ describe('Stripe - config', function () { getActiveStripeKeys: sinon.stub().returns(null) }; const config = getConfig({settingsHelpers, config: configUtils.config, urlUtils: {}}); - + should.equal(config, null); }); @@ -67,11 +59,11 @@ describe('Stripe - config', function () { const fakeUrlUtils = createUrlUtilsMock(); const config = getConfig({settingsHelpers, config: configUtils.config, urlUtils: fakeUrlUtils}); - + should.equal(config.secretKey, 'direct_secret'); should.equal(config.publicKey, 'direct_publishable'); should.equal(config.webhookHandlerUrl, 'http://site.com/subdir/members/webhooks/stripe/'); - + should.exist(config.checkoutSessionSuccessUrl); should.exist(config.checkoutSessionCancelUrl); should.exist(config.checkoutSetupSessionSuccessUrl); diff --git a/ghost/core/test/utils/urlUtils.js b/ghost/core/test/utils/urlUtils.js index f851c1a07c..2ad8bfb358 100644 --- a/ghost/core/test/utils/urlUtils.js +++ b/ghost/core/test/utils/urlUtils.js @@ -12,8 +12,6 @@ const getInstance = (options) => { getSubdir: config.getSubdir, getSiteUrl: config.getSiteUrl, getAdminUrl: config.getAdminUrl, - apiVersions: options.apiVersions, - defaultApiVersion: 'canary', slugs: options.slugs, redirectCacheMaxAge: options.redirectCacheMaxAge, baseApiPath: '/ghost/api'