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

Feat: Adds jest-axe and Card component test #2440

Merged
merged 10 commits into from
Sep 12, 2024

Conversation

hellofanny
Copy link
Contributor

What's the purpose of this pull request?

  • Setup @testing-library/jest-dom to help to test our components when checking an element's attributes, its text content, its css classes...
  • Adds Card component tests
  • Introduces accessibility tests: This won't guarantee that what we're building is accessible, but it's a first step towards it. 🥳
  • Updates CheckboxField component test

TODO: Document

How it works?

Currently, our components library do not have tests, but we want to introduce them for upcoming components. For existing components, we will gradually add tests retroactively.

How to test it?

  1. navigate to packages/components -> run yarn install
  2. run yarn test, you will be able to see the tests running
image
  1. removing <Label> component from CheckboxField, when running the step 2, you will get:
image

References

https://testing-library.com/docs/ecosystem-jest-dom
testing-library/jest-dom#546
NickColley/jest-axe#79

Copy link

vercel bot commented Sep 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 7:33pm

@hellofanny hellofanny marked this pull request as ready for review September 5, 2024 22:27
@hellofanny hellofanny requested a review from a team as a code owner September 5, 2024 22:27
@hellofanny hellofanny requested review from eduardoformiga and lucasfp13 and removed request for a team September 5, 2024 22:27
@hellofanny hellofanny self-assigned this Sep 5, 2024
Copy link

codesandbox-ci bot commented Sep 5, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@hellofanny hellofanny added the enhancement New feature or request label Sep 5, 2024
Copy link
Contributor

@lariciamota lariciamota left a comment

Choose a reason for hiding this comment

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

🎉 Great! 🎉

I've left only a few small comments 😄

Copy link
Contributor

@lucasfp13 lucasfp13 left a comment

Choose a reason for hiding this comment

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

Great!

@hellofanny hellofanny merged commit cd93d30 into main Sep 12, 2024
7 checks passed
@hellofanny hellofanny deleted the feat/add-card-component-test branch September 12, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants