Recommended approach for route-based tests within routes of react-router
问题 I'm using react-testing-library within a project of mine and am trying to write tests that validate in-app routing. e.g. testing that a button on the AccessDenied page brings you back to the Home page. I've been able to write these sorts of tests successfully for my App component because it defines all of the app routes. But if AccessDenied is one of those routes , how do I need to set up my tests to validate a button clicked there will route my back to Home? Here is a contrived example: App