aboutsummaryrefslogtreecommitdiffstats
path: root/.cypress/cypress/integration/bathnes.js
blob: 5598409d9d7c8b80e80c477991200b3c2fc22dff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 && lyr.fixmystreet.http_options.params && lyr.fixmystreet.http_options.params.TYPENAME === 'LLPG') {
                llpg++;
            }
        });
        expect(llpg).to.equal(1);
    });
});