I have a component that is working fine. However, I’m getting this issue whenever I try to run a test using <MockedProvider>
:
No more mocked responses for the query:
Followed by the query, then below it this:
Expected variables: {"id":<undefined>}
Failed to match 1 mock for this query, which had the following variables:
{"id":"123"}
I tried to supply it with the “expected variables” but that, of course, makes my query fail, and so the test fails anyway.
I’ve read previously that this issue can be caused when the data doesn’t match the query, however I console.log
ged the data, transformed it to a JavaScript object and have used that in my test.
Does anyone have an understanding of what’s happening here?