Jest testing current Recoil's state after change it #2253
Unanswered
joel-daros
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this simple state that stores the current filters applied:
And a hook to remove (set filter as undefined) when its removed:
And I want to test this hook, verifying that when I remove a specific filter like “Car” its value changes to undefined, and it doesn't affect the value of the other applied filters.
This is my current Jest / react-testing-libray file:
The test fails because the expected snapshot is not reflecting the current changes made in the
Car
filter.How I can properly get the current value of the state to assert its value is correct after I've removed one of the filters?
Beta Was this translation helpful? Give feedback.
All reactions