Cannot navigate to path using MemoryRouter while testing
According to documentation, if you use a regular Router
in your test, you should pass a history
prop to it
While you may be tempted to stub out the router context yourself, we recommend you wrap your unit test in one of the Router components: the base
Router
with a history prop, or a<StaticRouter>
,<MemoryRouter>
, or<BrowserRouter>
Hope this will work. If not, maybe using a second MemoryRouter
instead of Router
will simply do the job.