Skip to content
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

Merged
merged 14 commits into from
Mar 5, 2024

Conversation

dancormier
Copy link
Contributor

This PR adds visual and accessibility tests for the .s-post-summary component.

@dancormier dancormier requested a review from a team September 22, 2023 20:36
@netlify
Copy link

netlify bot commented Sep 22, 2023

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit e3b548d
🔍 Latest deploy log https://app.netlify.com/sites/stacks/deploys/65e63ac074739d00088fa243
😎 Deploy Preview https://deploy-preview-1499--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dancormier dancormier marked this pull request as ready for review February 7, 2024 19:25
Copy link
Contributor

@giamir giamir left a 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/components/post-summary/post-summary.a11y.test.ts Outdated Show resolved Hide resolved
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in d202db9

@dancormier dancormier merged commit af05bca into develop Mar 5, 2024
10 checks passed
@dancormier dancormier deleted the dcormier/post-summary-tests branch March 5, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants