[Javascript Testing] Add tests for App component #730
FeminismIsAwesome
started this conversation in
Temporarily Archived Tickets
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background:
We would like more confidence, especially with desires to update the UI and add new map-facing features, that the javascript is rendering as expected. This is a good place for those new to the project to start getting familiar with the javascript end of things.
Let's add tests for the App.jsx component!
Some suggestions for tests:
Adding an enzyme snapshot test (https://medium.com/codeclan/testing-react-with-jest-and-enzyme-20505fec4675)
Asserting that different if-block renders render with the right data (media image vs audio image)
Testing interactions, like "when this clicks, this state changes"
For starters, handleFilter might be a good place to start testing. Otherwise, feel free to just explore and add tests to any part--App is big, so don't feel compelled to tackle the whole hog.
Acceptance:
Running
docker-compose exec web yarn test
with the new tests does not break the javascript test suite.Beta Was this translation helpful? Give feedback.
All reactions