Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/layout.spec.js
Show All 17 Lines | cy.get('.swh-top-bar a') | ||||
.and('be.visible') | .and('be.visible') | ||||
.and('have.attr', 'href'); | .and('have.attr', 'href'); | ||||
}); | }); | ||||
it('should show donate button on lg screen', function() { | it('should show donate button on lg screen', function() { | ||||
cy.get('.swh-donate-link') | cy.get('.swh-donate-link') | ||||
.should('be.visible'); | .should('be.visible'); | ||||
}); | }); | ||||
it('should hide donate button on sm screen', function() { | it('should hide donate button on sm screen', function() { | ||||
cy.viewport(600, 800); | cy.viewport(600, 800); | ||||
cy.get('.swh-donate-link') | cy.get('.swh-donate-link') | ||||
.should('not.be.visible'); | .should('not.be.visible'); | ||||
}); | }); | ||||
it('should hide full width switch on small screens', function() { | |||||
cy.viewport(360, 740); | |||||
cy.get('#swh-full-width-switch-container') | |||||
.should('not.be.visible'); | |||||
cy.viewport(600, 800); | |||||
cy.get('#swh-full-width-switch-container') | |||||
.should('not.be.visible'); | |||||
cy.viewport(800, 600); | |||||
cy.get('#swh-full-width-switch-container') | |||||
.should('not.be.visible'); | |||||
}); | |||||
it('should show full width switch on large screens', function() { | |||||
cy.viewport(1024, 768); | |||||
cy.get('#swh-full-width-switch-container') | |||||
.should('be.visible'); | |||||
cy.viewport(1920, 1080); | |||||
cy.get('#swh-full-width-switch-container') | |||||
.should('be.visible'); | |||||
}); | |||||
it('should change container width when toggling Full width switch', function() { | it('should change container width when toggling Full width switch', function() { | ||||
cy.get('#swh-web-content') | cy.get('#swh-web-content') | ||||
.should('have.class', 'container') | .should('have.class', 'container') | ||||
.should('not.have.class', 'container-fluid'); | .should('not.have.class', 'container-fluid'); | ||||
cy.should(() => { | cy.should(() => { | ||||
expect(JSON.parse(localStorage.getItem('swh-web-full-width'))).to.be.null; | expect(JSON.parse(localStorage.getItem('swh-web-full-width'))).to.be.null; | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |