Closed mmahalwy closed 8 years ago
I would also like to see an example.
+1
We're in the process of migrating to react-router-redux (aka redux-simple-router) on the simple-router
branch. It will eventually merge into master. In that branch, the fetchData
functions are gone, replaced by a similar singular static method used by the redux-async-connect
library.
I recommend testing it out and opening new issues with any problems.
I have been having some trouble thinking about the best way to test a container that has both fetchData, fetchDataDeferred and some computation on the mergeState for @connect. Would love to get some thoughts on this.
Initially, I thought it'd really mimic the true functionality of the container is to calling fetchData and test the component there, then test what happens when fetchDataDeferred is called and what happens there, and so on.
You'll realize I made a big mistake in my test and that is calling fetchData before rendering the component and testing there... then when calling the deferred already my component is rendered and will not compute further changes.
My goal is either:
Thoughts?
Here is my test:
And here is my container: