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 all 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
19 changes: 10 additions & 9 deletions packages/internet-header/cypress/e2e/meta-navigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ describe('meta-navigation', () => {

describe('args', () => {
describe('meta: true', () => {
it(`adds meta navigation`, () => {
cy.changeArg('meta', true);
it.only(`adds meta navigation`, () => {
cy.changeArg('meta', 'true');
cy.pause();
cy.get('post-meta-navigation').should('exist').and('be.visible');
});

it(`sets css variable --meta-header-height to 0 in mobile view`, () => {
cy.viewport(1023, Cypress.config('viewportHeight'));
cy.changeArg('meta', true);
cy.changeArg('meta', 'true');
cy.get('swisspost-internet-header').within(() => {
cy.get('header').then($el => {
const style = getComputedStyle($el[0]);
Expand All @@ -30,7 +31,7 @@ describe('meta-navigation', () => {

it(`sets css variable --meta-header-height to 3rem in desktop view`, () => {
cy.viewport(1024, Cypress.config('viewportHeight'));
cy.changeArg('meta', true);
cy.changeArg('meta', 'true');
cy.get('swisspost-internet-header').within(() => {
cy.get('header').then($el => {
const style = getComputedStyle($el[0]);
Expand All @@ -43,12 +44,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);
cy.changeArg('meta', 'false');
cy.get('swisspost-internet-header').within(() => {
cy.get('header').then($el => {
const style = getComputedStyle($el[0]);
Expand All @@ -61,13 +62,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.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