Open romainleduc opened 4 years ago
Hello, the MockedProvider class not working correctly for me.
Example with MockedProvider:
describe('SignupForm', () => { test('renders without error', () => { renderer.create( <MockedProvider mocks={[]}> <SignupForm onValidation={() => console.log('redirect')} /> </MockedProvider>, ); }); });
I get the following error:
● SignupForm › renders without error Invariant Violation: Could not find "client" in the context or passed in as an option. Wrap the root component in an <ApolloProvider>, or pass an ApolloClient instance in via o ptions.
Example with bad pratice:
describe('SignupForm', () => { test('renders without error', () => { renderer.create( <ApolloProvider client={client}> <SignupForm onValidation={() => console.log('redirect')} /> </ApolloProvider> ); }); });
it works
My reactDOM render:
ReactDOM.render( <ApolloProvider client={client}> <CookiesProvider> <UserAuthProvider> <Router> <Routes /> </Router> </UserAuthProvider> </CookiesProvider> </ApolloProvider>, document.getElementById('root') );
Thanks for you help :)
@KiziKr were you able to solve it?
Hello, the MockedProvider class not working correctly for me.
Example with MockedProvider:
I get the following error:
Example with bad pratice:
it works
My reactDOM render:
Thanks for you help :)