diff options
-rw-r--r-- | .cypress/cypress/integration/simple_spec.js | 14 | ||||
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 8 |
3 files changed, 23 insertions, 0 deletions
diff --git a/.cypress/cypress/integration/simple_spec.js b/.cypress/cypress/integration/simple_spec.js index 39000a022..fe0867c76 100644 --- a/.cypress/cypress/integration/simple_spec.js +++ b/.cypress/cypress/integration/simple_spec.js @@ -14,3 +14,17 @@ describe('My First Test', function() { cy.get('form').submit(); }); }); + +describe('Clicking the "big green banner" on a map page', function() { + before(function() { + cy.visit('/'); + cy.get('[name=pc]').type('BS10 5EE'); + cy.get('#postcodeForm').submit(); + cy.get('.big-green-banner').click(); + }); + + it('begins a new report', function() { + cy.url().should('include', '/report/new'); + cy.get('#form_title').should('be.visible'); + }); +}); diff --git a/CHANGELOG.md b/CHANGELOG.md index efcdca382..b922ad5e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Increase size of "sub map links" (hide pins, permalink, etc) #2003 - Edge-to-edge email layout on narrow screens #2010 - Add default placeholder to report extra fields. #2027 + - Clicking the "Click map" instruction banner now begins a new report #2033 - Bugfixes: - Stop asset layers obscuring marker layer. #1999 - Don't delete hidden field values when inspecting reports. #1999 diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index c187c218c..443d7d986 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -669,6 +669,14 @@ $.extend(fixmystreet.set_up, { }); }, + clicking_banner_begins_report: function() { + $('.big-green-banner').on('click', function(){ + if (fixmystreet.map.getCenter) { + fixmystreet.display.begin_report( fixmystreet.map.getCenter() ); + } + }); + }, + map_controls: function() { //add permalink on desktop, force hide on mobile //add links container (if its not there) |