We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ad1670 commit aa0a0bbCopy full SHA for aa0a0bb
src/tests/Login.test.jsx
@@ -147,6 +147,8 @@ it('redirects to Home if user is logged in', () => {
147
const history = createBrowserHistory();
148
history.replace = jest.fn();
149
150
+ const pathToHome = '/';
151
+
152
render(
153
<AuthContext.Provider value={{ isAuth: true }}>
154
<Router history={history}>
@@ -158,6 +160,6 @@ it('redirects to Home if user is logged in', () => {
158
160
expect(screen.queryByRole('button', { name: "Login" })).not.toBeInTheDocument();
159
161
162
expect(history.replace).toHaveBeenCalledWith(expect.objectContaining({
- pathname: '/'
163
+ pathname: pathToHome,
164
}));
165
});
0 commit comments