I'm trying to use Enzyme to test a component's method. I know the typical way to do this is to use Enzyme's instance()
method.
The thing is, this only work for root
component and my component need to be wrapper in two Context provider to render (namely, react-router and apollo client).
const wrapper = mount(
<ApolloProvider client={client}>
<MemoryRouter initialEntries={["/login"]}>
<AuthFormContainer />
</MemoryRouter>
</ApolloProvider>
);
How can I test methodA
of AuthFormContainer
in that case ?