This repository was archived by the owner on Jan 1, 2025. It is now read-only.
Repository navigation
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
Uh oh!
There was an error while loading. Please reload this page.
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
Carfilter.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?
All reactions