Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(internet-header): Fix e2e after improving the main slot #2503

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Expand Up @@ -3,7 +3,7 @@ import { prepare } from '../support/prepare-story';
describe('main-navigation', () => {
describe('slotted element: false', () => {
beforeEach(() => {
prepare('Internet Header/Header', 'Default');
prepare('Components/Internet Header/Header', 'Default');
});

it('should not have any custom content', () => {
Expand All @@ -17,7 +17,7 @@ describe('main-navigation', () => {

describe('slotted element: true', () => {
beforeEach(() => {
prepare('Internet Header/Header/Custom Content', 'Default');
prepare('Components/Internet Header/Header/Custom Content', 'Default');

cy.get('swisspost-internet-header').find('[slot=main]').as('slotted-element');
cy.get('swisspost-internet-header')
Expand Down
10 changes: 5 additions & 5 deletions packages/internet-header/cypress/e2e/meta-navigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ describe('meta-navigation', () => {

describe('meta: false', () => {
it(`removes meta navigation`, () => {
cy.changeArg('meta', false);
cy.changeArg('meta', 'false');
cy.get('post-meta-navigation').should('not.exist');
});

it(`sets css variable --meta-header-height to 0`, () => {
cy.changeArg('meta', false);
it.only(`sets css variable --meta-header-height to 0`, () => {
cy.changeArg('meta', 'false');
cy.get('swisspost-internet-header').within(() => {
cy.get('header').then($el => {
const style = getComputedStyle($el[0]);
Expand All @@ -61,13 +61,13 @@ describe('meta-navigation', () => {

describe('meta: changes during runtime (false => true => false)', () => {
it(`adds and removes meta navigation`, () => {
cy.changeArg('meta', false);
cy.changeArg('meta', 'false');
cy.get('post-meta-navigation').should('not.exist');

cy.changeArg('meta', true);
cy.get('post-meta-navigation').should('exist').and('be.visible');

cy.changeArg('meta', false);
cy.changeArg('meta', 'false');
cy.get('post-meta-navigation').should('not.exist');
});
});
Expand Down