-
Notifications
You must be signed in to change notification settings - Fork 12
chore: #210 use self-closing tags in tests #211
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
chore: #210 use self-closing tags in tests #211
Conversation
| <img src="https://www.greenwoodjs.io/assets/greenwood-logo-og.png" alt="Greenwood logo"> | ||
| <br> | ||
| <img src="https://www.greenwoodjs.io/assets/greenwood-logo-og.png" alt="Greenwood logo" /> | ||
| <br /> |
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.
hmm, I thought the issue was that the expected would be without the closing / for these void elements?
I can understand if we start with <img/> but end up with <img> but shouldn't parse5 be stripping the closing / and thus the expected should be <img>?
| pictureFrame = dom.window.document.querySelectorAll('wcc-picture-frame'); | ||
| expectedHtml = await fs.readFile(new URL('./expected.html', import.meta.url), 'utf-8'); | ||
| const rawExpectedHtml = await fs.readFile(new URL('./expected.html', import.meta.url), 'utf-8'); | ||
| expectedHtml = serialize(parseFragment(rawExpectedHtml)); |
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, I see yes, you said you would run the expected HTML through parse5, thus getting our compliant HTML output.
Maybe we can just leave a comment here regarding this just to add a little context for this change here?
52ad4f7 to
43b2f4f
Compare
thescientist13
left a comment
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.
Thanks!
This PR updates a test to use self-closing tags. This will make it compatible with Prettier and unblock #209 using self closing tags in the test files, but running them through parser5 in the tests, we get the best of both world: compliant html & auto formatting.
Related Issue
Resolves #210
Summary of Changes
/>to a test expected.html file