Default the cookie banner to be hidden

It should only be shown if JS is available and the
cookieMessage JS finds consent has not been set.
This commit is contained in:
Tom Byers
2020-01-14 12:11:40 +00:00
parent b6e37a6ac8
commit c18cb1e984
4 changed files with 11 additions and 23 deletions

View File

@@ -21,6 +21,13 @@ describe("Cookie message", () => {
beforeAll(() => {
const cookieMessageStyles = document.createElement('style');
// add the CSS that hides the cookie message by default
cookieMessageStyles.textContent = '.notify-cookie-banner { display: none; }';
document.getElementsByTagName('head')[0].appendChild(cookieMessageStyles);
// protect against any previous tests setting a cookies-policy cookie
helpers.deleteCookie('cookies-policy');
});