Skip to content

Commit

Permalink
update navigaion test for new nav classes
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Feb 13, 2025
1 parent 39c0052 commit c4d54e3
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions tests/cypress/integration/navigation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,84 +20,84 @@ describe( 'Navigation', { testIsolation: true }, function () {

// test main nav
it( 'Main nav links properly navigates', () => {
cy.get( '.wppbh-app-navitem-Marketplace' ).should(
cy.get( '.wppbh-app-navitem-marketplace' ).should(
'not.have.class',
'active'
);
cy.get( '.wppbh-app-navitem-Marketplace' ).click();
cy.get( '.wppbh-app-navitem-marketplace' ).click();
cy.wait( 500 );
cy.hash().should( 'eq', '#/marketplace' );
cy.get( '.wppbh-app-navitem-Marketplace' ).should(
cy.get( '.wppbh-app-navitem-marketplace' ).should(
'have.class',
'active'
);

cy.get( '.wppbh-app-navitem-Performance' ).click();
cy.get( '.wppbh-app-navitem-performance' ).click();
cy.wait( 500 );
cy.hash().should( 'eq', '#/performance' );
cy.get( '.wppbh-app-navitem-Performance' ).should(
cy.get( '.wppbh-app-navitem-performance' ).should(
'have.class',
'active'
);
cy.get( '.wppbh-app-navitem-Marketplace' ).should(
cy.get( '.wppbh-app-navitem-marketplace' ).should(
'not.have.class',
'active'
);

cy.get( '.wppbh-app-navitem-Settings' ).click();
cy.get( '.wppbh-app-navitem-settings' ).click();
cy.wait( 500 );
cy.hash().should( 'eq', '#/settings' );
} );

it( 'Subnav links properly navigates', () => {
cy.get( '.wppbh-app-navitem-Marketplace' )
cy.get( '.wppbh-app-navitem-marketplace' )
.scrollIntoView()
.should( 'not.have.class', 'active' );
cy.get( '.wppbh-app-navitem-Marketplace' ).click();
cy.get( '.wppbh-app-navitem-marketplace' ).click();

cy.wait( 500 );
cy.hash().should( 'eq', '#/marketplace' );
cy.get( '.wppbh-app-navitem-Marketplace' ).should(
cy.get( '.wppbh-app-navitem-marketplace' ).should(
'have.class',
'active'
);

cy.get( '.wppbh-app-subnavitem-Services' ).click();
cy.get( '.wppbh-app-subnavitem-services' ).click();
cy.wait( 500 );
cy.hash().should( 'eq', '#/marketplace/services' );
cy.get( '.wppbh-app-subnavitem-Services' ).should(
cy.get( '.wppbh-app-subnavitem-services' ).should(
'have.class',
'active'
);
cy.get( '.wppbh-app-navitem-Marketplace' ).should(
cy.get( '.wppbh-app-navitem-marketplace' ).should(
'have.class',
'active'
);

cy.get( '.wppbh-app-subnavitem-SEO' ).click();
cy.get( '.wppbh-app-subnavitem-seo' ).click();
cy.wait( 500 );
cy.hash().should( 'eq', '#/marketplace/seo' );
cy.get( '.wppbh-app-subnavitem-SEO' ).should( 'have.class', 'active' );
cy.get( '.wppbh-app-subnavitem-Services' ).should(
cy.get( '.wppbh-app-subnavitem-seo' ).should( 'have.class', 'active' );
cy.get( '.wppbh-app-subnavitem-services' ).should(
'not.have.class',
'active'
);
cy.get( '.wppbh-app-navitem-Marketplace' ).should(
cy.get( '.wppbh-app-navitem-marketplace' ).should(
'have.class',
'active'
);

cy.get( '.wppbh-app-navitem-Performance' ).click();
cy.get( '.wppbh-app-navitem-performance' ).click();
cy.wait( 500 );
cy.get( '.wppbh-app-subnavitem-Services' ).should(
cy.get( '.wppbh-app-subnavitem-services' ).should(
'not.have.class',
'active'
);
cy.get( '.wppbh-app-subnavitem-SEO' ).should(
cy.get( '.wppbh-app-subnavitem-seo' ).should(
'not.have.class',
'active'
);
cy.get( '.wppbh-app-navitem-Marketplace' ).should(
cy.get( '.wppbh-app-navitem-marketplace' ).should(
'not.have.class',
'active'
);
Expand Down Expand Up @@ -125,13 +125,13 @@ describe( 'Navigation', { testIsolation: true }, function () {
cy.viewport( 'iphone-x' );
cy.get( '#nfd-app-mobile-nav' ).should( 'be.visible' );

cy.get( '.wppbh-app-navitem-Home' ).should( 'not.exist' );
cy.get( '.wppbh-app-navitem-home' ).should( 'not.exist' );

cy.get( '#nfd-app-mobile-nav' ).click();
cy.wait( 500 );
cy.get( '.wppbh-app-navitem-Home' ).should( 'be.visible' );
cy.get( '.wppbh-app-navitem-home' ).should( 'be.visible' );
cy.get( 'button.nfd-modal__close-button' ).should( 'be.visible' );
cy.get( 'button.nfd-modal__close-button' ).click();
cy.get( '.wppbh-app-navitem-Home' ).should( 'not.exist' );
cy.get( '.wppbh-app-navitem-home' ).should( 'not.exist' );
} );
} );

0 comments on commit c4d54e3

Please # to comment.