Skip to content

Commit

Permalink
test(documentation): update header e2e test pages (#4111)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschuerch authored Nov 29, 2024
1 parent 62ebad8 commit b7ea821
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/internet-header/cypress/e2e/breadcrumbs.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IPortalConfig } from '../../src/models/general.model';
import rawTestConfiguration from '../fixtures/internet-header/test-configuration.json';
import { prepare } from '../support/prepare-story';
import { BREADCRUMBS, BREADCRUMBS_CUSTOM_ITEMS } from './shared/variables';
import { BREADCRUMBS } from './shared/variables';

const testConfiguration: IPortalConfig = rawTestConfiguration as any;

Expand Down Expand Up @@ -40,7 +40,7 @@ describe('breadcrumb', () => {
});

it(`should add custom elements`, () => {
prepare(BREADCRUMBS_CUSTOM_ITEMS, 'Default');
prepare(BREADCRUMBS, 'CustomItems');

cy.changeArg('custom-items', [
{ text: 'Test1', url: '/x/y/z' },
Expand Down
4 changes: 2 additions & 2 deletions packages/internet-header/cypress/e2e/main-navigation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import testConfiguration from '../fixtures/internet-header/test-configuration.json';
import { prepare } from '../support/prepare-story';
import { HEADER, HEADER_CUSTOM_CONFIG } from './shared/variables';
import { HEADER } from './shared/variables';

describe('main-navigation', () => {
beforeEach(() => {
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('main-navigation', () => {
});

it('Changes active link also in custom config nav links', () => {
prepare(HEADER_CUSTOM_CONFIG, 'Default');
prepare(HEADER, 'CustomConfig');
cy.changeArg('language', 'en');
cy.changeArg('active-route', 'https://maps.google.com');
cy.get('swisspost-internet-header')
Expand Down
4 changes: 2 additions & 2 deletions packages/internet-header/cypress/e2e/main-slot.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { prepare } from '../support/prepare-story';
import { HEADER, HEADER_CUSTOM_CONTENT } from './shared/variables';
import { HEADER } from './shared/variables';

describe('main-navigation', () => {
describe('slotted element: false', () => {
Expand All @@ -18,7 +18,7 @@ describe('main-navigation', () => {

describe('slotted element: true', () => {
beforeEach(() => {
prepare(HEADER_CUSTOM_CONTENT, 'Default');
prepare(HEADER, 'CustomContent');

cy.get('swisspost-internet-header').find('[slot=main]').as('slotted-element');
cy.get('swisspost-internet-header')
Expand Down
5 changes: 1 addition & 4 deletions packages/internet-header/cypress/e2e/shared/variables.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export const HEADER = 'ebb11274-091b-4cb7-9a3f-3e0451c9a865';
export const HEADER_CUSTOM_CONFIG = 'bfdf4e7c-37d3-40f8-a5d0-734f3e6612b4';
export const HEADER_CUSTOM_CONTENT = 'f09859db-8270-482b-a884-5b5584f86a45';
export const FOOTER = '27fc009d-3eec-43a9-b3a2-55531e721817';
export const BREADCRUMBS = '4347e5bf-8bf2-4f44-9075-9faaa53591ed';
export const BREADCRUMBS_CUSTOM_ITEMS = 'b93adeff-9bb8-4f23-a81d-96452a94fd9b';
export const FOOTER = '27fc009d-3eec-43a9-b3a2-55531e721817';

0 comments on commit b7ea821

Please sign in to comment.