govuk_publishing_components
govuk_publishing_components copied to clipboard
Add GA testing for the Accordion
What
Add tests for GA (Google Analytics) "Show all sections" and each individual section tracking for the Accordion.
Why
As part of this PR click-event-tracking has been added the Accordion so when a user interacts with "Show all sections" or an individual section this can be sent to GA. These are behind feature flags.
However testing needs to be added, the Accordion testing moves away from testing a copy of the HTML and tests against the actual rendered component making the test more accurate. However for the context of this PR partially restoring the Jasmine test GA is required
Ideally we need to
- [ ] Restore Jasmine (
accordion-spec.js
) file - [ ] Extend the tests to ensure that tracking works as expected.
(An alternative approach would be add GA to the dummy_app
and testing against that).
http://govuk-publishing-components.dev.gov.uk/accordionexample
Conversation happening here
Anything else
Draft WiP PR is here