I've tried reading around quite a lot for this, a bit confused if this is fixed or not now in Enzyme/React. However I've got some code which makes an API call (using Axios) then once it's successfully called the API updates a state value using of showResults
to true
using setShowResults()
which is using useState()
.
In my unit tests which I'm using Jest and Enzyme, I can't test the contents of my app to see data being rendered as the state is set to false
. How do I set a state value in Enzyme when using using wrapper.setState({ showResults: true });
doesn't work?