Conversation
|
Thanks for your insights on this! We just this week upgraded from react-router v3 to v5 and I’m still figuring out what that means for testing. I can tell that you started working on this before and then we merged in those changes and broke everything 🙃 — sorry! As part of the upgrade I added a As far as this particular error that you are getting, it’s due to the upgrades that we just merged in. The With this current setup that we have in test-utils, I think your test should work without adding a |
|
Oh great it's being upgraded! And that I swapped out browser history inside test-utils for Should I clean this up and remove the file? Or move the memory history into this file and perhaps rename to |
I think that what you have now is great. You actually cannot name the file The If we ever do want to test the redirects which use the |
Fixes a todo item in tests.
Changes:
Adding a test to check
ButtonOrLinkwill render in a router and triggers a history change.I think there could be an opportunity here to add a helper to
test-utilsperhapsrenderWithRoutesorroutesRender. Similar toreduxRender.Side Note: I also tried installing
userEventa companion package fromtesting-libraryhttps://testing-library.com/docs/ecosystem-user-event/
But
npm run linthad an issue with it when I tried to included it intest-utilsI have verified that this pull request:
npm run lint)npm run test)developbranch.Fixes #123