-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update page template tests to use jsdom #5062
Conversation
The next commit will refactor the tests to make use of jsdom which requires us to update the filename so that we get the jsdom test environment. Doing this in two commits so that git shows the changes to the file rather than treating it as an addition and a deletion.
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for 6523197 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! Another test migrated to JSDom 🙌🏻 ⛵
document.open() | ||
document.write(contents) | ||
document.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one for replacing the whole document content 🙌🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests didn't work otherwise as anything that was meant to be in the <head>
ended up in the <body>
!
@@ -357,7 +357,7 @@ describe('Template', () => { | |||
.digest('base64') | |||
|
|||
// A change to the inline script would be a breaking change, and it would also require | |||
// updating the hash published in https://frontend.design-system.service.gov.uk/importing-css-assets-and-javascript/#if-your-javascript-isn-t-working-properly | |||
// updating the hash published in https://frontend.design-system.service.gov.uk/import-javascript/#use-a-hash-to-unblock-inline-javascript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch 🦅
Update page template tests to use jsdom
Part of #5010.