Answer the question
In order to leave comments, you need to log in
How to test react component with routing using Enzyme?
Testing a react component with enzyme. I call the mount function for deep rendering. const component = mount(MyComponent)
But firstly, the application uses the redux store, and secondly, one of the children has , respectively, the react swears that the link can only be inside the router and that to use the store you need to wrap it in a provider. After the wrapper, it is not clear how to find the component itself in the returned value in order to call any of its functions and / or re-render. At least returns an object with length = 0
What is done in such cases? <Link />
component.find(MyComponent)
Answer the question
In order to leave comments, you need to log in
React Router: Testing
Redux: Writing tests. Connected Components
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question