This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle cases where the headings do not appear on the page
The body of a guide is rendered using a shared ‘GovSpeak’ component. In test mode shared components are not fetched from Static. Instead they are rendered as a dummy tag which contains a JSON dump of the locals - the arguments passed to the component. This means that the headings we expect to be present on the page (within the body of the guide) are not present. This which was causing JavaScript errors on the page, which were appearing in unrelated tests that used the Javascript driver to execute. By returning early if we cannot get the offset of a heading we guard against this.
- Loading branch information