Skip to content

Commit

Permalink
fix nav tests
Browse files Browse the repository at this point in the history
  • Loading branch information
circlecube committed Jan 3, 2024
1 parent a5b6bce commit c04d81e
Showing 1 changed file with 6 additions and 34 deletions.
40 changes: 6 additions & 34 deletions tests/cypress/integration/navigation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ describe('Navigation', function () {

});

it( "Admin submenu shouldn't exist inside app", () => {
cy.get( '#adminmenu #toplevel_page_hostgator ul.wp-submenu' ).should(
'not.exist'
);
} );

it('Logo Links to home', () => {
cy.get('.hgwp-logo-wrap').click();
cy.wait(500);
cy.hash().should('eq', '#/home');
});

it('Admin Subnav properly highlights', () => {
cy
.get('#adminmenu #toplevel_page_hostgator')
.should('have.class', 'wp-has-current-submenu');
cy
.get('#adminmenu #toplevel_page_hostgator ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /home/);
});

// test main nav
it('Main nav links properly navigates', () => {
Expand All @@ -35,10 +31,6 @@ describe('Navigation', function () {
cy
.get('.hgwp-app-navitem-Marketplace')
.should('have.class', 'active');
cy
.get('#adminmenu #toplevel_page_hostgator ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);

cy.get('.hgwp-app-navitem-Performance').click();
cy.wait(500);
Expand All @@ -49,18 +41,10 @@ describe('Navigation', function () {
cy
.get('.hgwp-app-navitem-Marketplace')
.should('not.have.class', 'active');
cy
.get('#adminmenu #toplevel_page_hostgator ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /performance/);

cy.get('.hgwp-app-navitem-Settings').click();
cy.wait(500);
cy.hash().should('eq', '#/settings');
cy
.get('#adminmenu #toplevel_page_hostgator ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /settings/);
});

it('Subnav links properly navigates', () => {
Expand All @@ -75,21 +59,13 @@ describe('Navigation', function () {
cy
.get('.hgwp-app-navitem-Marketplace')
.should('have.class', 'active');
cy
.get('#adminmenu #toplevel_page_hostgator ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);

cy.get('.hgwp-app-subnavitem-Services').click();
cy.wait(500);
cy.hash().should('eq', '#/marketplace/services');
cy
.get('.hgwp-app-subnavitem-Services')
.should('have.class', 'active');
cy
.get('#adminmenu #toplevel_page_hostgator ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);
cy
.get('.hgwp-app-navitem-Marketplace')
.should('have.class', 'active');
Expand All @@ -104,10 +80,6 @@ describe('Navigation', function () {
cy
.get('.hgwp-app-subnavitem-Services')
.should('not.have.class', 'active');
cy
.get('#adminmenu #toplevel_page_hostgator ul.wp-submenu li.current a')
.should('have.attr', 'href')
.and('match', /marketplace/);
cy
.get('.hgwp-app-navitem-Marketplace')
.should('have.class', 'active');
Expand Down

0 comments on commit c04d81e

Please sign in to comment.