Skip to content

Conversation

@AntoineDeveloppeur
Copy link

Description

Please do not merge yet. This PR is meant to get first approval about how change will be implemented

Add snapshot tests to Button and BottomBar component

  • Fixes: #(163)

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Could you tell me if add tests is how you thought issue should be solved.

  • Use @testing-library/react with Jest
  • Snapshot tests written in already existing rendering test files.
  • Snapshot test inside another "describe" to clarify test file
  • Snapshot files are saved in ComponentToTest/_test_/_snapshots_

Waiting for your feedback to add tests to

  • HomeComponents
  • LandingComponents

@its-me-abhishek
Copy link
Collaborator

hi @AntoineDeveloppeur , this implementation looks great overall, the snapshots residing in __tests__/__snapshots__ also makes sense. Though one thing I think that needs to be done is addition of a testing script for snapshots in the package.json, and it should be separate from npm test ( this is because one may not want to run snapshots everytime they run tests). so a script named as snapshots would be good. And finally integrating that into our frontend-testing workflow for testing via Github actions, inside /.github/workflows/frontend-test.yml

@AntoineDeveloppeur
Copy link
Author

Thanks for your feedback. I agree with your suggestions and will handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants