Skip to content

Commit

Permalink
Merge pull request #2672 from RedHatInsights/master
Browse files Browse the repository at this point in the history
[stable] Update build
  • Loading branch information
florkbr authored Nov 17, 2023
2 parents 46682ac + 2853d38 commit b5605c6
Show file tree
Hide file tree
Showing 36 changed files with 1,255 additions and 1,187 deletions.
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default defineConfig({
},
},
e2e: {
blockHosts: ['static.redhat.com', 'consent.trustarc.com', 'www.redhat.com/en/cms/ajax/site-switcher'],
blockHosts: ['consent.trustarc.com'],
baseUrl: 'https://stage.foo.redhat.com:1337/beta',
env: {
E2E_USER: process.env.E2E_USER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ describe('<AllServicesDropdown />', () => {
it('should close all services dropdown in link matches current pathname', () => {
function checkMenuClosed() {
cy.get('.pf-v5-c-menu-toggle__text').click();
cy.contains('Browse all services').should('exist');
cy.contains('All services').should('exist');
cy.contains('Favorites').click();
cy.contains('Test section').click();
cy.contains('Test link').click();
cy.contains('Browse all services').should('not.exist');
cy.contains('All services').should('not.exist');
}
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services.json', [
{
Expand Down
74 changes: 74 additions & 0 deletions cypress/component/AllServicesPage/AllServicesPage.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from 'react';
import AllServices from '../../../src/layouts/AllServices';
import { BrowserRouter } from 'react-router-dom';
import { IntlProvider } from 'react-intl';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import { ScalprumProvider } from '@scalprum/react-core';
import { getVisibilityFunctions, initializeVisibilityFunctions } from '../../../src/utils/VisibilitySingleton';
import userFixture from '../../fixtures/testUser.json';
import { ChromeUser } from '@redhat-cloud-services/types';

describe('<AllServices />', () => {
beforeEach(() => {
// mock chrome and scalprum generic requests
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/services/services.json', {
status: 200,
fixture: 'services.json',
});
cy.intercept('http://localhost:8080/entry?cacheBuster=*', '');
cy.intercept('http://localhost:8080/foo/bar.json', {
foo: {
entry: ['/entry'],
},
});
cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/navigation/settings-navigation.json?ts=*', {
status: 200,
fixture: 'settings-navigation.json',
});
// cy.intercept('http://localhost:8080/api/chrome-service/v1/static/stable/stage/navigation/*-navigation.json?ts=*', {
// data: [],
// });
});

it('should filter by service category title', () => {
initializeVisibilityFunctions({
getToken: () => Promise.resolve(''),
getUser: () => Promise.resolve(userFixture as unknown as ChromeUser),
getUserPermissions: () => Promise.resolve([]),
});
const visibilityFunctions = getVisibilityFunctions();
const store = createStore(() => ({
chrome: {
moduleRoutes: [
{
path: '/test/link',
scope: 'foo',
module: 'bar',
},
],
},
}));
cy.mount(
<ScalprumProvider
config={{}}
api={{
chrome: {
visibilityFunctions,
},
}}
>
<BrowserRouter>
<Provider store={store}>
<IntlProvider locale="en">
<AllServices />
</IntlProvider>
</Provider>
</BrowserRouter>
</ScalprumProvider>
);

cy.get('.pf-v5-c-text-input-group__text-input').type('consoleset');
cy.contains('Console Settings').should('exist');
});
});
4 changes: 2 additions & 2 deletions cypress/e2e/release-gate/navigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ describe('Navigation', () => {
cy.get('.chr-c-link-service-toggle').click();

// check if favorite services links exist
cy.contains('.pf-v5-c-tabs__link', 'My favorite services');
cy.contains('.pf-v5-c-tabs__link', 'Favorites');

// click on all services
cy.get('.chr-l-flex__item-browse-all-services a').click();
cy.get('.chr-l-stack__item-browse-all-services a').click();

// get users link
cy.get('p:contains("Users")').click();
Expand Down
69 changes: 0 additions & 69 deletions cypress/e2e/release-gate/search.cy.tsx

This file was deleted.

Loading

0 comments on commit b5605c6

Please sign in to comment.