I’m trying to force a loading state using MockedProvider. The docs say:
You can test how your component is rendered while it’s still awaiting a query result. In fact, this is a test’s default behavior if it doesn’t explicitly wait for the
Promise
-based result fromMockedProvider
.
This works great when testing snapshots for example. However the problem with this is that I want to show it in storybook and have a control for loading/ready. I’d like to toggle it myself.
Is there a way to change the state myself? For example, update what useQuery returns (loading, data, error) manually?
I could mock useQuery, but I think there’s a better way of doing it.