-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading prop in MockedProvider is always true #101
Comments
@Emiliano-Bucci The API changed in the new version and |
@lfades Yeah, i think about that a bit later. In any case, i'm using it this way:
And this is my
and even removing the |
@Emiliano-Bucci Could you move export const WithApollo = withApollo(
({ initialState }) => {
const httpLink = new BatchHttpLink({
uri: process.env.graphqlEndpoint,
})
return new ApolloClient({
link: httpLink,
cache: new InMemoryCache({
addTypename: true,
}).restore(initialState || {}),
})
}, |
@lfades Done but sadly nothing change :/ |
@Emiliano-Bucci Ok so your example looks very similar to my integration tests, that are currently working, so maybe it's because of the version of your Apollo packages, what versions are you using?. You can check the integration tests to see what versions are working there. |
@lfades Ok thanks, i will take a look :) |
@lfades I've tried to downgrade to the same versions that you have but still no luck; the only thing i've noticed is that you don't have installed |
@lfades Don't know if this matters, but i've created a simple test with a simple query, and i'm getting this warning:
This is my component file:
And this is what i get from the console:
Can be possibly related? I've also noticed one really strange thing: If for some reason i change the
It seems that during tests Apollo is trying to make a network request... :/ |
@lfades I continue to investigate; i've made a simple test removing the Edit: Ok, i can confirm that there's some weird issue happening here: if i remove the WithApollo HOC and normally export the page, and inside the tests i use the I've fixed it doing this:
|
Is it possible that with the new version of the
withApollo
theloading
prop is always true? It seems that jest don't await anymore to the promise to be resolved.The text was updated successfully, but these errors were encountered: