diff options
Diffstat (limited to '.cypress/cypress/integration/bathnes.js')
-rw-r--r-- | .cypress/cypress/integration/bathnes.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/.cypress/cypress/integration/bathnes.js b/.cypress/cypress/integration/bathnes.js index c675c34fa..1acbd3602 100644 --- a/.cypress/cypress/integration/bathnes.js +++ b/.cypress/cypress/integration/bathnes.js @@ -2,3 +2,27 @@ it('loads the right front page', function() { cy.visit('http://bathnes.localhost:3001/'); cy.contains('North East Somerset'); }); + +it('loads the staff layer correctly', function() { + cy.request({ + method: 'POST', + url: 'http://bathnes.localhost:3001/auth?r=/', + form: true, + body: { username: 'admin@example.org', password_sign_in: 'password' } + }); + cy.visit('http://bathnes.localhost:3001/'); + cy.contains('Your account'); + cy.get('[name=pc]').type(Cypress.env('postcode')); + cy.get('[name=pc]').parents('form').submit(); + cy.url().should('include', '/around'); + cy.window().its('fixmystreet.maps').should('have.property', 'banes_defaults'); + cy.window().then(function(win){ + var llpg = 0; + win.fixmystreet.map.layers.forEach(function(lyr) { + if (lyr.fixmystreet && lyr.fixmystreet.http_options.params.TYPENAME === 'LLPG') { + llpg++; + } + }); + expect(llpg).to.equal(1); + }); +}); |