enabled not working on testing
I am trying to test a component that relies on a useQuery hook. For other tests this works fine, however for the component that has the enabled flag set I don't get any data from the useQuery hook and also isLoading stays true.
The strange thing is that when I log the enabled value it is logged as true but the test doesn't pass.
If I however uncomment the enabled flag my test passes 🤷🏼♂️
See printscreen. Is there anything special I need to do when enabled flag is set to make my test pass?
It's like in the test after enabled is true there is no more render anymore so I don't get the data
this is my test
and see screenshot of my useQueryhook

0 Replies