Commit Graph

9 Commits

Author SHA1 Message Date
Tom Byers
1d9c5e5da9 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.
2020-01-20 10:04:58 +00:00
Tom Byers
b17140ac46 Fix test description 2020-01-20 10:03:47 +00:00
Tom Byers
8a0d0a15a8 Hide cookie banner if no-js
Decided in discussions with @quis and @yahoopete
that users without JS available cannot
accept/reject analytics cookies so the banner has
no use.
2020-01-20 10:03:47 +00:00
Tom Byers
9a0d522964 Add JS tests for analytics & cookies JS
Includes:
- tests for the analytics interface ported from
  GOVUK Frontend Toolkit
- tests for the cookie banner that appears on all
  pages except the cookies page
- tests for the cookies page JS
- tests for the hasConsentFor function
- adding a deleteCookie helper to remove
  cookies during tests
- polyfill for insertAdjacentText

The last one is because JSDOM doesn't support
insertAdjacentText but our target browsers
do. This polyfill also includes one for
insertAdjacentHTML.
2020-01-20 10:03:36 +00:00
Leo Hemsted
66db735e09 Revert "Merge pull request #3238 from alphagov/cookies-update"
This reverts commit eec4bec761, reversing
changes made to 64480e2fff.
2020-01-15 14:40:48 +00:00
Tom Byers
c18cb1e984 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.
2020-01-14 12:11:40 +00:00
Tom Byers
7d31431cef Fix test description 2020-01-08 17:48:37 +00:00
Tom Byers
f156fe2e95 Hide cookie banner if no-js
Decided in discussions with @quis and @yahoopete
that users without JS available cannot
accept/reject analytics cookies so the banner has
no use.
2020-01-08 10:23:52 +00:00
Tom Byers
900aa19bd3 Add JS tests for analytics & cookies JS
Includes:
- tests for the analytics interface ported from
  GOVUK Frontend Toolkit
- tests for the cookie banner that appears on all
  pages except the cookies page
- tests for the cookies page JS
- tests for the hasConsentFor function
- adding a deleteCookie helper to remove
  cookies during tests
- polyfill for insertAdjacentText

The last one is because JSDOM doesn't support
insertAdjacentText but our target browsers
do. This polyfill also includes one for
insertAdjacentHTML.
2020-01-06 13:38:34 +00:00