diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-06-04 17:21:17 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-06-05 17:54:31 +0100 |
commit | eb2ea71af214843f5af35a478573d0192f54864d (patch) | |
tree | 9ca2cdd5034bb4500ad9a1021d67fcaf8e80c823 | |
parent | 0fb90368bb990ffa3ceab8d7ff2d345194f08d6f (diff) |
[Northamptonshire] Add emergency message test.
-rw-r--r-- | .cypress/cypress/integration/northamptonshire.js | 13 | ||||
-rwxr-xr-x | bin/fixmystreet.com/fixture | 15 |
2 files changed, 27 insertions, 1 deletions
diff --git a/.cypress/cypress/integration/northamptonshire.js b/.cypress/cypress/integration/northamptonshire.js index 082f03de1..376d72cd0 100644 --- a/.cypress/cypress/integration/northamptonshire.js +++ b/.cypress/cypress/integration/northamptonshire.js @@ -70,3 +70,16 @@ it('detects multiple assets at same location', function() { cy.contains('more than one tree at this location'); }); + +it('shows the emergency message', function() { + cy.server(); + cy.route('/report/new/ajax*').as('report-ajax'); + cy.visit('http://northamptonshire.localhost:3001/'); + cy.get('[name=pc]').type('NN1 2NS'); + cy.get('[name=pc]').parents('form').submit(); + cy.get('#map_box').click(); + cy.wait('@report-ajax'); + cy.get('[id=category_group]').select('Very Urgent'); + cy.contains('Please call us instead, it is very urgent.'); + cy.get('#form_title').should('not.be.visible'); +}); diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index 8332bbe17..f1d004f31 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -94,7 +94,7 @@ for my $cat ('Dropped Kerbs', 'Skips') { if ($opt->test_fixtures) { my $bodies; foreach ( - { area_id => 2234, categories => ['Fallen Tree'], name => 'Northamptonshire County Council' }, + { area_id => 2234, categories => ['Fallen Tree', 'Very Urgent'], name => 'Northamptonshire County Council' }, { area_id => 2217, categories => ['Flytipping', 'Roads'], name => 'Buckinghamshire County Council' }, { area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' }, ) { @@ -104,6 +104,19 @@ if ($opt->test_fixtures) { } my $child_cat = FixMyStreet::DB->resultset("Contact")->find({ + body => $bodies->{2234}, + category => 'Very Urgent', + }); + $child_cat->set_extra_fields({ + code => 'emergency', + datatype => 'string', + description => 'Please call us instead, it is very urgent.', + order => 1, + variable => 'false', + }); + $child_cat->update; + + $child_cat = FixMyStreet::DB->resultset("Contact")->find({ body => $bodies->{2217}, category => 'Flytipping', }); |