From fb54e7511fb8f00a9941f7e239e59c5f69222463 Mon Sep 17 00:00:00 2001 From: Jon Hallam Date: Thu, 29 Aug 2019 16:08:00 +0100 Subject: [PATCH 1/2] Add exception to global banner Trello - https://trello.com/c/SDXLEewr/190-stop-brexit-banner-showing-on-brexit --- app/views/notifications/_global_bar.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/notifications/_global_bar.html.erb b/app/views/notifications/_global_bar.html.erb index 337efaea4..b465a2704 100644 --- a/app/views/notifications/_global_bar.html.erb +++ b/app/views/notifications/_global_bar.html.erb @@ -8,7 +8,7 @@ <% if show_global_bar %> <% content_for :head do %> - + <% end %> From 9d2f17a583bed60ae9f146bf0029861d25d0ac05 Mon Sep 17 00:00:00 2001 From: Bruce Bolt Date: Thu, 29 Aug 2019 17:38:38 +0100 Subject: [PATCH 2/2] Add tests for global banner exceptions --- spec/javascripts/global-bar-class-toggle.spec.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/spec/javascripts/global-bar-class-toggle.spec.js b/spec/javascripts/global-bar-class-toggle.spec.js index 7dbe76132..9ce6978ee 100644 --- a/spec/javascripts/global-bar-class-toggle.spec.js +++ b/spec/javascripts/global-bar-class-toggle.spec.js @@ -21,7 +21,7 @@ describe("toggling a global bar HTML class based on cookie", function () { } function urlPermitsShow() { - return !/^\/register-to-vote|^\/done/.test(window.location.pathname); + return !/^\/register-to-vote|^\/done|^\/brexit|^\/get-ready-brexit-check/.test(window.location.pathname); } function viewCountPermitsShow() { @@ -48,7 +48,7 @@ describe("toggling a global bar HTML class based on cookie", function () { var window = fakeWindow || root; /* begin minify */ - !function(t){"use strict";function e(){return!/^\/register-to-vote|^\/done/.test(window.location.pathname)}function n(){var e=t.cookie.match("(?:^|[ ;])global_bar_seen=([0-9]+)");return e?parseInt(e.pop(),10)<3:!0}var o=t.documentElement;e()&&n()&&(o.className=o.className.concat(" show-global-bar"))}(document); + !function(t){"use strict";function e(){return!/^\/register-to-vote|^\/done|^\/brexit|^\/get-ready-brexit-check/.test(window.location.pathname)}function n(){var e=t.cookie.match("(?:^|[ ;])global_bar_seen=([0-9]+)");return e?parseInt(e.pop(),10)<3:!0}var o=t.documentElement;e()&&n()&&(o.className=o.className.concat(" show-global-bar"))}(document); /* end minify */ } @@ -121,6 +121,16 @@ describe("toggling a global bar HTML class based on cookie", function () { globalBarFn({location: {pathname: '/done'}}); expectGlobalBarToBeHidden(); }); + + it("does not show on brexit landing page", function() { + globalBarFn({location: {pathname: '/brexit'}}); + expectGlobalBarToBeHidden(); + }); + + it("does not show on brexit checker pages", function() { + globalBarFn({location: {pathname: '/get-ready-brexit-check'}}); + expectGlobalBarToBeHidden(); + }); } function expectGlobalBarToShow() {