Last active
March 20, 2023 18:23
-
-
Save Mohammad-Faisal/f5bef01454c89bd592396f77d7561c10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('Test navigation' , () => { | |
const ui = renderConnected( | |
<> | |
<FirstPage /> | |
<Route path="/second-page">Second Page</Route> | |
</>, | |
{ initialState } | |
); | |
expect(screen.queryByText('Second Page')).toBeNull(); | |
expect(screen.getByText(/First Page/)).toBeDefined(); | |
// do the action | |
const button = utils.getByText(/Submit/); | |
fireEvent.click(button); | |
// the navigation should occur at this point and we should be on the second page | |
expect(screen.getByText(/Second Page/)).toBeDefined(); | |
expect(screen.queryByText(/First Page/)).toBeNull(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment