diff options
author | Chris Mytton <chrismytton@gmail.com> | 2019-10-18 15:14:48 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-11-13 11:58:51 +0000 |
commit | 6936cdfd98213c337edf8fce78105834b9421267 (patch) | |
tree | 2e95614d9f29258cba8c52a1a3cdb2a37ecfdd3d | |
parent | a313421307a99d6859d66eec58336157aed4d1fb (diff) |
Add integration test for setting a Confirm site_code
I want to change the `updateUSRNField` method so that it can accept an
array of objects in the `usrn` key, but before doing that I want to add
a test to ensure the existing behaviour is tested, to ensure I'm not
breaking anything.
-rw-r--r-- | .cypress/cypress/integration/buckinghamshire.js | 9 | ||||
-rwxr-xr-x | bin/fixmystreet.com/fixture | 17 |
2 files changed, 25 insertions, 1 deletions
diff --git a/.cypress/cypress/integration/buckinghamshire.js b/.cypress/cypress/integration/buckinghamshire.js index 1f4641952..d5b14100a 100644 --- a/.cypress/cypress/integration/buckinghamshire.js +++ b/.cypress/cypress/integration/buckinghamshire.js @@ -42,4 +42,13 @@ describe('flytipping', function() { cy.get('body').should('contain', 'Thank you for your report'); }); + it('sets the site_code correctly', function() { + cy.get('.olMapViewport #fms_pan_zoom_zoomin').click(); + cy.wait('@roads-layer'); + cy.get('#map_box').click(290, 307); + cy.wait('@report-ajax'); + cy.get('select:eq(4)').select('Parks'); + cy.get('[name=site_code]').should('have.value', '7300268'); + }); + }); diff --git a/bin/fixmystreet.com/fixture b/bin/fixmystreet.com/fixture index 1f6063a47..1fa17dfad 100755 --- a/bin/fixmystreet.com/fixture +++ b/bin/fixmystreet.com/fixture @@ -95,7 +95,7 @@ if ($opt->test_fixtures) { my $bodies; foreach ( { area_id => 2234, categories => ['Fallen Tree', 'Very Urgent'], name => 'Northamptonshire County Council' }, - { area_id => 2217, categories => ['Flytipping', 'Roads'], name => 'Buckinghamshire County Council' }, + { area_id => 2217, categories => ['Flytipping', 'Roads', 'Parks'], name => 'Buckinghamshire County Council' }, { area_id => 2257, categories => ['Flytipping', 'Graffiti'], name => 'Chiltern District Council' }, { area_id => 2397, categories => [ 'Graffiti' ], name => 'Northampton Borough Council' }, { area_id => 2483, categories => [ 'Potholes', 'Other' ], name => 'Hounslow Borough Council' }, @@ -139,6 +139,21 @@ if ($opt->test_fixtures) { $child_cat->update; $child_cat = FixMyStreet::DB->resultset("Contact")->find({ + body => $bodies->{2217}, + category => 'Parks', + }); + $child_cat->set_extra_fields({ + code => 'site_code', + datatype => 'string', + description => 'site code', + order => 100, + required => 'false', + variable => 'true', + automated => 'hidden_field', + }); + $child_cat->update; + + $child_cat = FixMyStreet::DB->resultset("Contact")->find({ body => $bodies->{2483}, category => 'Other', }); |