aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.cypress/cypress/integration/regressions.js12
-rw-r--r--CHANGELOG.md1
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js5
3 files changed, 18 insertions, 0 deletions
diff --git a/.cypress/cypress/integration/regressions.js b/.cypress/cypress/integration/regressions.js
index 547fc469b..af6a1d73d 100644
--- a/.cypress/cypress/integration/regressions.js
+++ b/.cypress/cypress/integration/regressions.js
@@ -42,4 +42,16 @@ describe('Regression tests', function() {
cy.get('#map_sidebar').contains('M&S').click();
cy.title().should('contain', 'M&S "brill" says <glob>');
});
+
+ it('hides the report when going from around to report to form', function() {
+ cy.server();
+ cy.route('/report/*').as('show-report');
+ cy.visit('/around?lon=-2.295894&lat=51.526877&zoom=6');
+ // force to hopefully work around apparent Cypress SVG issue
+ cy.get('image[title="Lights out in tunnel"]:last').click({force: true});
+ cy.wait('@show-report');
+ cy.get('.report-a-problem-btn').eq(0).should('contain', 'Report another problem here').click();
+ cy.get('.content').should('not.contain', 'toddler');
+ });
+
});
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d1771247c..cbaabf68f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
* Unreleased
- Bugfixes:
- Prevent creation of two templates with same title.
+ - Fix bug going between report/new pages client side
- Development improvements:
- Upgrade the underlying framework and a number of other packages.
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index bf7d5457f..11e9045ab 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -1286,6 +1286,9 @@ fixmystreet.display = {
}
$('#side').hide();
$('#map_box .big-green-banner').hide();
+ $('#side-report').remove();
+ $('.two_column_sidebar').remove();
+ $('body').removeClass('with-actions');
if (fixmystreet.map.updateSize) {
fixmystreet.map.updateSize(); // required after changing the size of the map element
@@ -1355,6 +1358,8 @@ fixmystreet.display = {
if ($sideReport.length) {
$('#side').hide(); // Hide the list of reports
+ $('#side-form').hide(); // And the form
+ $('body').removeClass('with-notes');
$('#map_box .big-green-banner').hide();
// Remove any existing report page content from sidebar
$('#side-report').remove();