diff options
-rw-r--r-- | .cypress/cypress/integration/highways.js | 2 | ||||
-rw-r--r-- | web/cobrands/highways/assets.js | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/.cypress/cypress/integration/highways.js b/.cypress/cypress/integration/highways.js index 7f7214ae8..4c66e074e 100644 --- a/.cypress/cypress/integration/highways.js +++ b/.cypress/cypress/integration/highways.js @@ -24,5 +24,7 @@ describe('Highways England tests', function() { cy.get('#js-councils_text').should('contain', 'Highways England'); cy.get('#single_body_only').should('have.value', 'Highways England'); cy.get('#form_category').should('contain', 'Sign issue'); + cy.get('#category_group').select('Sign issue'); + cy.get('#form_category').should('have.value', 'Sign issue'); }); }); diff --git a/web/cobrands/highways/assets.js b/web/cobrands/highways/assets.js index 2f00834d2..1607bc193 100644 --- a/web/cobrands/highways/assets.js +++ b/web/cobrands/highways/assets.js @@ -66,7 +66,6 @@ fixmystreet.assets.add(defaults, { $('#highways').remove(); if ( !fixmystreet.assets.selectedFeature() ) { add_highways_warning(feature.attributes.ROA_NUMBER); - $('#category_meta').empty(); } }, not_found: function(layer) { @@ -83,6 +82,11 @@ fixmystreet.assets.add(defaults, { function regenerate_category(he_flag) { if (!fixmystreet.reporting_data) return; + fixmystreet.body_overrides.location = { + latitude: $('#fixmystreet\\.latitude').val(), + longitude: $('#fixmystreet\\.longitude').val() + }; + // Restart the category dropdown from the original data (not all of it as // we keep subcategories the same) var select = $(fixmystreet.reporting_data.category).filter('select'); @@ -103,7 +107,6 @@ function regenerate_category(he_flag) { } function he_selected() { - fixmystreet.body_overrides.location = null; fixmystreet.body_overrides.only_send('Highways England'); fixmystreet.body_overrides.allow_send('Highways England'); regenerate_category(true); @@ -111,14 +114,10 @@ function he_selected() { } function non_he_selected() { - fixmystreet.body_overrides.location = { - latitude: $('#fixmystreet\\.latitude').val(), - longitude: $('#fixmystreet\\.longitude').val() - }; fixmystreet.body_overrides.remove_only_send(); fixmystreet.body_overrides.do_not_send('Highways England'); - $(fixmystreet).trigger('report_new:highways_change'); regenerate_category(false); + $(fixmystreet).trigger('report_new:highways_change'); } function add_highways_warning(road_name) { |