-
Notifications
You must be signed in to change notification settings - Fork 90
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
test(post-summary): add a11y, visual test #1499
Conversation
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 for adding tests for this component @dancormier. 🙏
Overall it looks good and could be merged in my opinion. It's a complex component with a complex setup and there are some minor refactoring that could always be done but the screenshots looks good. It's not so easy for me to understand the many variations people could potentially use this component with even by looking at the docs page. 😅
The main comment I had was to keep those complex test setups close to the tests file instead of the shared /test
folder (unless we plan to share them with other components).
Sidenote
I believe that if we would use Stacks Svelte Components our test setup would look less convoluted because the markup rendering logic will be abstracted away by a simplified API. As we continue building the Svelte library, in future we could consider a simplification of these complex test setups by using components. 🙂
lib/test/post-summary-test-utils.ts
Outdated
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.
I like that you have extracted shared setup functions in this file. I even think you could extract more.
Regarding the placement of this file though I would prefer to keep it close to where it is used. I think I have left a similar comment in another PR recently.
The idea would be to standardize around something like this post-summary.test.setup.ts
and then make sure the *.setup.ts
files are removed from the tsconfig.build configuration. Thoughts?
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.
Addressed in d202db9
This PR adds visual and accessibility tests for the
.s-post-summary
component.