[Javascript Testing] Add tests for Filter component #744
Replies: 4 comments
-
May I take this one? |
Beta Was this translation helpful? Give feedback.
-
@leosoaivan yes i think nobody else is working on it! |
Beta Was this translation helpful? Give feedback.
-
@FeminismIsAwesome having a tough time with this one. Snapshot testing is fine, but I'm finding that the functionality is a bit difficult to test without fully mocking out the functions in App.js that handle the change in Filter's props, namely Since the handling of Filter's props has been hoisted up to Additionally, after further looking, it would appear that the fix for #564 would have to be in App.js as well, since that is where |
Beta Was this translation helpful? Give feedback.
-
Any updates or thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
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 Filter.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 (different filterItem)
Testing interactions, like "when this clicks, this state changes"
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