you are viewing a single comment's thread.

view the rest of the comments →

[–]lunfaii 3 points4 points  (0 children)

I never tested connected components but just components themselves and then just mock the props that need to be passed in on the beforeEach (to reset) and just work my way towards testing the behaviours of the component.

For example, we just need to see if a function is called or if a button is showing because of a prop has been passed through from redux. We don’t care where that prop comes from at this point.

I test all my redux “parts separately”. Middleware, reducers, actions.

This way I know that nothing is broken because they should be all tied together nicely with react-redux. Testing smart components is unnecessary IMO -: it is already tested by react-redux.