From 7b4d70257eb972f06e3e1e9e8e41fb9241b97a4a Mon Sep 17 00:00:00 2001 From: Vijet Mahabaleshwar Date: Thu, 3 Sep 2020 09:47:56 -0700 Subject: [PATCH] Addresses Haisheng's comments --- .../e2e/harness/start-custom-login-server.js | 25 ++----------------- .../test/e2e/specs/custom-login-page.js | 10 +++++--- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js b/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js index c2178fdc7..a005b8633 100644 --- a/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js +++ b/packages/oidc-middleware/test/e2e/harness/start-custom-login-server.js @@ -12,27 +12,7 @@ const constants = require('../util/constants'); const util = require('../util/util'); -let options = {}; -let cdnUrl = 'https://global.oktacdn.com/okta-signin-widget/4.4.1'; - -// This is used as PDV for widget after artifact promotion to CDN -if(process.env.NPM_TARBALL_URL) { - // Extract the version of sign-in widget from the NPM_TARBALL_URL variable - // The variable is of the format https:/@okta/okta-signin-widget-3.0.6.tgz - const url = process.env.NPM_TARBALL_URL; - const i = url.lastIndexOf('-'); - const version = url.substring(i + 1, url.length - 4); - cdnUrl=`https://global.oktacdn.com/okta-signin-widget/${version}`; - - // We also test i18n assets on CDN - options.language = 'fr'; - options.i18n = { - fr: { - 'primaryauth.title': 'Connectez-vous à Acme', - } - } -} -console.log(`Using CDN url - ${cdnUrl}`); +const cdnUrl = 'https://global.oktacdn.com/okta-signin-widget/4.4.1'; const serverOptions = { issuer: constants.ISSUER, @@ -42,8 +22,7 @@ const serverOptions = { testing: { disableHttpsCheck: constants.OKTA_TESTING_DISABLEHTTPSCHECK }, - cdnUrl: cdnUrl, - options: options + cdnUrl: cdnUrl } console.log('serverOptions', serverOptions); diff --git a/packages/oidc-middleware/test/e2e/specs/custom-login-page.js b/packages/oidc-middleware/test/e2e/specs/custom-login-page.js index 56cc545fe..ca7578102 100644 --- a/packages/oidc-middleware/test/e2e/specs/custom-login-page.js +++ b/packages/oidc-middleware/test/e2e/specs/custom-login-page.js @@ -20,16 +20,17 @@ browser.waitForAngularEnabled(false); describe('Custom login page', () => { let server; beforeEach(async () => { - let cdnUrl = 'https://global.oktacdn.com/okta-signin-widget/4.4.1'; - let options = {}; + let widgetVersion = '4.4.1'; + const options = {}; + // This is used as PDV for widget after artifact promotion to CDN if(process.env.NPM_TARBALL_URL) { // Extract the version of sign-in widget from the NPM_TARBALL_URL variable // The variable is of the format https:/@okta/okta-signin-widget-3.0.6.tgz const url = process.env.NPM_TARBALL_URL; const i = url.lastIndexOf('-'); - const version = url.substring(i + 1, url.length - 4); - cdnUrl=`https://global.oktacdn.com/okta-signin-widget/${version}`; + widgetVersion = url.substring(i + 1, url.length - 4); + // We also test i18n assets on CDN options.language = 'fr'; options.i18n = { @@ -38,6 +39,7 @@ describe('Custom login page', () => { } } } + const cdnUrl = `https://global.oktacdn.com/okta-signin-widget/${widgetVersion}`; console.log(`Using CDN url - ${cdnUrl}`); const serverOptions = {