diff options
author | Struan Donald <struan@exo.org.uk> | 2019-07-16 15:31:16 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-09-27 17:35:15 +0100 |
commit | 10f175e50ef96de471b2262a43b6af4719ce19a0 (patch) | |
tree | f73f7427efa5b097a3bba5bf4d24aae97848810f | |
parent | 3e82f19d86ca2c7766c85b189a568b1f84082d80 (diff) |
[IsleOfWight] frontend tests for roadworks.org integration
-rw-r--r-- | .cypress/cypress/fixtures/iow_roadworks.json | 97 | ||||
-rw-r--r-- | .cypress/cypress/integration/isleofwight.js | 12 |
2 files changed, 109 insertions, 0 deletions
diff --git a/.cypress/cypress/fixtures/iow_roadworks.json b/.cypress/cypress/fixtures/iow_roadworks.json new file mode 100644 index 000000000..b20dd8514 --- /dev/null +++ b/.cypress/cypress/fixtures/iow_roadworks.json @@ -0,0 +1,97 @@ +{ + "query": { + "recordcount": 38, + "columnlist": "se_id,phase_id,u_se_id,longitude,latitude,gsymbol_id,tooltip,swtype,org_name_disp,promoter,source,promoter_works_ref,originator_ref,swa_org_ref,promoter_org_ref,publisher_orgref,publisher_organisation_id,promoter_organisation_id,organisation_id,lha_id,start_date,end_date,works_state,impact,works_desc,geom_type,geojson_wgs84,tm_cat", + "data": { + "se_id": [ + 114013162 + ], + "phase_id": [ + 1 + ], + "u_se_id": [ + "114013162:1" + ], + "longitude": [ + -1.29574 + ], + "latitude": [ + 50.71086 + ], + "gsymbol_id": [ + "gcln01y" + ], + "tooltip": [ + "B3401 Whitepit Lane, Newport, Isle of Wight\\n18 Jun 2019 - 23 Jul 2019\\ndelays unlikely" + ], + "swtype": [ + "cw" + ], + "org_name_disp": [ + "Island Roads on behalf of the Isle of Wight Council" + ], + "promoter": [ + "Island Roads on behalf of the Isle of Wight Council" + ], + "source": [ + "SW" + ], + "promoter_works_ref": [ + "RF101BT0103000021728" + ], + "originator_ref": [ + "RF101BT0103000021728" + ], + "swa_org_ref": [ + 2114 + ], + "promoter_org_ref": [ + 2114 + ], + "publisher_orgref": [ + 2114 + ], + "publisher_organisation_id": [ + 1062 + ], + "promoter_organisation_id": [ + 1062 + ], + "organisation_id": [ + 1062 + ], + "lha_id": [ + 62 + ], + "start_date": [ + "{ts '2019-06-18 00:00:00'}" + ], + "end_date": [ + "{ts '2030-07-23 23:59:59'}" + ], + "works_state": [ + 4 + ], + "impact": [ + 1 + ], + "works_desc": [ + "Parapet improvement NEWPORT" + ], + "geom_type": [ + 1 + ], + "geojson_wgs84": [ + "{\"type\":\"Point\",\"coordinates\":[-1.295784,50.71086]}" + ], + "tm_cat": [ + "" + ] + } + }, + "reqtoken": "", + "filterimpact": "1,2,3,4", + "filterenddate": "16/10/2019", + "filterstartdate": "16/07/2019", + "timeperiod": "cw" +} diff --git a/.cypress/cypress/integration/isleofwight.js b/.cypress/cypress/integration/isleofwight.js index bc88807ec..ab1c17941 100644 --- a/.cypress/cypress/integration/isleofwight.js +++ b/.cypress/cypress/integration/isleofwight.js @@ -18,4 +18,16 @@ describe('When you look at the Island Roads site', function() { cy.get('select:eq(4)').select('Private'); cy.contains('sent to Island Roads'); }); + + it('displays nearby roadworks', function() { + cy.fixture('iow_roadworks.json'); + cy.route('/data/**', 'fixture:iow_roadworks.json').as('roadworks'); + cy.visit('http://isleofwight.localhost:3001/'); + cy.get('[name=pc]').type('PO30 5XJ'); + cy.get('[name=pc]').parents('form').submit(); + cy.get('#map_box').click(); + cy.wait('@report-ajax'); + cy.wait('@roadworks'); + cy.contains('Roadworks are scheduled near this location'); + }); }); |