diff --git a/cypress/component/Auth/auth.spec.ts b/cypress/component/Auth/auth.spec.ts index c2c303528..53a77a685 100644 --- a/cypress/component/Auth/auth.spec.ts +++ b/cypress/component/Auth/auth.spec.ts @@ -23,11 +23,7 @@ describe('Auth Failure', function () { describe('Auth Success', function () { // Intercept configuration calls beforeEach(() => { - cy.intercept({ - method: 'GET', - url: '/config.json', - hostname: 'localhost', - }, {'env': 'ci'}); + cy.initApplicationConfig(); cy.stub(OAuth2, 'getConfig').returns({ 'authorityEndpoint': Cypress.config().baseUrl, 'clientId': 'clientId' diff --git a/cypress/component/Auth/oidcBroker.spec.ts b/cypress/component/Auth/oidcBroker.spec.ts index 047381ad6..8e3cce39b 100644 --- a/cypress/component/Auth/oidcBroker.spec.ts +++ b/cypress/component/Auth/oidcBroker.spec.ts @@ -24,11 +24,7 @@ describe('OidcBroker Failure', function () { describe('OidcBroker Success', function () { // Intercept configuration calls beforeEach(() => { - cy.intercept({ - method: 'GET', - url: '/config.json', - hostname: 'localhost', - }, {'env': 'ci'}); + cy.initApplicationConfig(); cy.stub(OAuth2, 'getConfig').returns({ 'authorityEndpoint': Cypress.config().baseUrl, 'clientId': 'clientId' diff --git a/cypress/component/DataSearch/dataset_search_filters.spec.js b/cypress/component/DataSearch/dataset_search_filters.spec.js index d19a0f712..a8bb21c17 100644 --- a/cypress/component/DataSearch/dataset_search_filters.spec.js +++ b/cypress/component/DataSearch/dataset_search_filters.spec.js @@ -2,7 +2,6 @@ import { mount } from 'cypress/react'; import React from 'react'; -import {Storage} from '../../../src/libs/storage'; import DatasetFilterList from '../../../src/components/data_search/DatasetFilterList'; const duosUser = { @@ -10,13 +9,8 @@ const duosUser = { }; describe('Data Library Filters', () => { - // Intercept configuration calls beforeEach(() => { - cy.intercept({ - method: 'GET', - url: '/config.json', - hostname: 'localhost', - }, { 'env': 'ci' }); + cy.initApplicationConfig(); }); it('Renders the data library filters', () => { diff --git a/cypress/component/DataSearch/dataset_search_page.spec.js b/cypress/component/DataSearch/dataset_search_page.spec.js index 6bba8e28e..a82ea2fcb 100644 --- a/cypress/component/DataSearch/dataset_search_page.spec.js +++ b/cypress/component/DataSearch/dataset_search_page.spec.js @@ -10,13 +10,8 @@ const duosUser = { }; describe('Data Library', () => { - // Intercept configuration calls beforeEach(() => { - cy.intercept({ - method: 'GET', - url: '/config.json', - hostname: 'localhost', - }, { 'env': 'ci' }); + cy.initApplicationConfig(); }); it('Renders the data library without a query', () => { diff --git a/cypress/component/TermsOfService/tos_acceptance.spec.js b/cypress/component/TermsOfService/tos_acceptance.spec.js index 5290220b7..5175a90f2 100644 --- a/cypress/component/TermsOfService/tos_acceptance.spec.js +++ b/cypress/component/TermsOfService/tos_acceptance.spec.js @@ -20,11 +20,7 @@ const mocks = { describe('Terms of Service Acceptance Page', function () { // Intercept configuration calls beforeEach(async () => { - cy.intercept({ - method: 'GET', - url: '/config.json', - hostname: 'localhost', - }, {'env': 'ci'}); + cy.initApplicationConfig(); cy.stub(OAuth2, 'getConfig').returns({ 'authorityEndpoint': 'authorityEndpoint', 'clientId': 'clientId' diff --git a/cypress/component/UserProfile/user_profile.spec.js b/cypress/component/UserProfile/user_profile.spec.js index e50436dad..4046bcea4 100644 --- a/cypress/component/UserProfile/user_profile.spec.js +++ b/cypress/component/UserProfile/user_profile.spec.js @@ -12,13 +12,8 @@ const duosUser = { }; describe('User Profile', () => { - // Intercept configuration calls beforeEach(() => { - cy.intercept({ - method: 'GET', - url: '/config.json', - hostname: 'localhost', - }, {'env': 'ci'}); + cy.initApplicationConfig(); }); it('Renders the user profile page', () => { diff --git a/cypress/component/utils/metrics.spec.ts b/cypress/component/utils/metrics.spec.ts index b927a4cb6..111cd3c4f 100644 --- a/cypress/component/utils/metrics.spec.ts +++ b/cypress/component/utils/metrics.spec.ts @@ -4,13 +4,8 @@ import eventList from '../../../src/libs/events'; describe('Metrics Tests', function () { - // Intercept configuration calls beforeEach(() => { - cy.intercept({ - method: 'GET', - url: '/config.json', - hostname: 'localhost', - }, {'env': 'ci'}); + cy.initApplicationConfig(); }); Cypress._.each(Object.keys(eventList), (eventType) => {