Skip to content

Commit

Permalink
test: replace local config interception with initApplicationConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Nov 21, 2024
1 parent 1aa444c commit e65e5eb
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 40 deletions.
6 changes: 1 addition & 5 deletions cypress/component/Auth/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 1 addition & 5 deletions cypress/component/Auth/oidcBroker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 1 addition & 7 deletions cypress/component/DataSearch/dataset_search_filters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@

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 = {
isSigningOfficial: false,
};

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', () => {
Expand Down
7 changes: 1 addition & 6 deletions cypress/component/DataSearch/dataset_search_page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
6 changes: 1 addition & 5 deletions cypress/component/TermsOfService/tos_acceptance.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 1 addition & 6 deletions cypress/component/UserProfile/user_profile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
7 changes: 1 addition & 6 deletions cypress/component/utils/metrics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e65e5eb

Please sign in to comment.