FormidableLabs / redux-little-router

A tiny router for Redux that lets the URL do the talking.
MIT License
1.04k stars 114 forks source link

How to test (context troubles) #283

Closed granmoe closed 6 years ago

granmoe commented 6 years ago

It seems that it isn't possible to get the component tree to update with the route when simulating clicking <Link> in tests. I suspect this is due to missing context. I saw that there used to be a <RouterProvider> context component and then there was a provideRouter function. Is there a way to provide the appropriate context to the component tree in tests, akin to wrapping the component to be tested in a <Provider> component of some kind so that the component tree updates when the route changes?

granmoe commented 6 years ago

I noticed this fakeContext stuff in your tests. Could I do something similar?