test: add tests for CookieBanner
For #5 (closed)
What does this MR do?
- Contracts the behaviour of the feature via a Gherkin file (this doesn't correspond to any programmatic tests, but makes it easy to see what the feature does).
- Adds
jest
and related packages, plus ajest.config.js
. - Adds snapshot tests for
CookieBanner
and lower level components. - Makes some eslintrc changes to support jest / ts
Checks
npm test
Merge request reports
Activity
assigned to @bw509
@ek599's requesting that we get these tests running in CI, so I've marked this as a draft. Will merge back and fix the pipeline problem simultaneously after !4 (merged) is resolved.
added 8 commits
Toggle commit listI think this one is essentially ready for review. I will debug the pre-commit problem, but this is separate from the test changes.
(It appears as though eslint is failing to find the eslint dependency, which is a bit of a strange one...)
Edited by Benjamin WoodsLooking for things to review - not involved with anything else in the project so I'm probably not best to progress.
What I'm don't understand is this jest snapshot testing. It appears to just be testing that react produces some very specific html (i.e. unique css classnames that we don't actually know will stay the same). Surely tests should be testing functionality not react build implementation? Or have I misunderstood?
added 1 commit
- 4ec5b7b3 - chore: revert eslint changes until pre-commit problem solved elsewhere
added 1 commit
- 77d419cb - chore: revert eslint changes until pre-commit problem solved elsewhere
added 1 commit
- 350a950c - chore: revert eslint changes until pre-commit problem solved elsewhere
mentioned in commit 2a0bd257