menu
Channels
Team
Posts
Members
Info

MockedProvider mutation failing (onMutationCompleted error), any example?

Hi, I am facing this issue during tests: https://github.com/apollographql/react-apollo/issues/3478 …

thumbsup
0
message-simple
1

Error in my React Unit Test with named mutation with refetchQuery

Error: UnhandledPromiseRejectionWarning: Error: Network error: No more mocked responses for the query: query AnalyisQuery($id: Int, $name: String) { My Setup …

thumbsup
0
message-simple
5

How to unit test the ApolloProvider from @apollo/react-hooks queries using…

When using MockedProvider in tests, I get the below error is there a different MockedProvider test-utils to test the version of the hooks? Currently, I'm testing it using with the below workaround …

thumbsup
0
message-simple
9

How do I test that a mutation is run when using MockedProvider?

Hi! I'm working with React and Apollo. I have a component with a button that fires a mutation when clicked. I would like to write a test that confirms that when the button is clicked, the mutation is fired. Reading the docs on testing mutations there doesn't seem to be a way to…

thumbsup
3
message-simple
10

Proper unit test for a Query wrapped component

Hi Guys, We have started writing unit tests for our application components. We have tried all the available examples but each one is ending up with an error. Can someone help with how to write test with latest version of apollo, mockprovider and act. Here is what we need. We…

thumbsup
1
message-simple
21

React Apollo 3 - Warning during tests

I'm testing a component which contains Query component. Test is fairly simple: Even though it's not the most useful test ever, it used to work with no warning. But since I upgraded react-apollo to v3, some warnings show up in the console: As state update is done by Apollo…

thumbsup
1
message-simple
4
Deleted·11d# Testing

apollo-datasource-rest + Typescript + Jest

I am setting up a new project using Apollo, TypeScript & Jest and I'm running into some difficulty testing my datasources that extent RESTDataSource. Jest will not mock the class to be extended & much of the advice I'm coming across recommends switching to composition over…

thumbsup
1
message-simple
2

Which library to use for unit testing

Hi Guys, Which testing library to use when an Application is using apollo 3, In Memory Cache, Redux and Formik?

thumbsup
1
message-simple
0

MockedProvider & React.cloneElement

I'm trying to understand the purpose of this: https://github.com/apollographql/react-apollo/blob/master/packages/testing/src/mocks/MockedProvider.tsx#L41 It's there in the initial commit...

thumbsup
0
message-simple
0

How to unit test composed components with both client side and server side…

This is how my component is: This is how my test looks like : When I print the components only the mock of the ServerSide returns something but the clientside is empty. I don't seem to find any examples of how to test composed queries

thumbsup
1
message-simple
1