diff --git a/src/reset-password/tests/ResetPasswordPage.test.jsx b/src/reset-password/tests/ResetPasswordPage.test.jsx
index af3583597..e25bce312 100644
--- a/src/reset-password/tests/ResetPasswordPage.test.jsx
+++ b/src/reset-password/tests/ResetPasswordPage.test.jsx
@@ -10,7 +10,6 @@ import { MemoryRouter } from 'react-router-dom';
import BaseContainer from '../../base-container';
import { appId } from '../../constants';
-import { LOGIN_PAGE } from '../../data/constants';
import { RegisterProvider } from '../../register/components/RegisterContext';
import ResetPasswordPage from '../ResetPasswordPage';
@@ -40,6 +39,7 @@ jest.mock('@openedx/frontend-base', () => ({
userId: 3,
username: 'test-user',
})),
+ getUrlByRouteRole: jest.fn(() => '/mock-url'),
}));
jest.mock('react-router-dom', () => ({
@@ -329,7 +329,7 @@ describe('ResetPasswordPage', () => {
fireEvent.click(resetPasswordButton);
await waitFor(() => {
- expect(mockedNavigator).toHaveBeenCalledWith(LOGIN_PAGE, {
+ expect(mockedNavigator).toHaveBeenCalledWith('/mock-url', {
state: { showResetPasswordSuccessBanner: true },
});
});
@@ -354,7 +354,7 @@ describe('ResetPasswordPage', () => {
const signInTab = screen.getByText('Sign in');
fireEvent.click(signInTab);
- expect(mockedNavigator).toHaveBeenCalledWith(LOGIN_PAGE);
+ expect(mockedNavigator).toHaveBeenCalledWith('/mock-url');
});
it('should handle reset password onError with token_invalid true', async () => {
diff --git a/src/routes.jsx b/src/routes.jsx
index 9546f5144..a30005621 100644
--- a/src/routes.jsx
+++ b/src/routes.jsx
@@ -1,5 +1,9 @@
import { EmbeddedRegistrationRoute, NotFoundPage, UnAuthOnlyRoute } from './common-components';
-import { LOGIN_PAGE } from './data/constants';
+import {
+ confirmPasswordRole, loginPath, loginRole, notFoundPath,
+ passwordResetConfirmPath, registerEmbeddedPath, registerPath, registerRole,
+ resetPath, resetPasswordRole, welcomePath, welcomeRole,
+} from './constants';
import { ForgotPasswordPage } from './forgot-password';
import Logistration from './logistration/Logistration';
import { ProgressiveProfiling } from './progressive-profiling';
@@ -16,58 +20,58 @@ const routes = [
},
children: [
{
- path: 'register-embedded',
+ path: registerEmbeddedPath,
element: (
),
},
{
- path: 'login',
+ path: loginPath,
handle: {
- role: 'org.openedx.frontend.role.login',
+ role: loginRole,
},
element: (
-
+
),
},
{
- path: 'register',
+ path: registerPath,
handle: {
- role: 'org.openedx.frontend.role.register',
+ role: registerRole,
},
element: (
),
},
{
- path: 'reset',
+ path: resetPath,
handle: {
- role: 'org.openedx.frontend.role.resetPassword',
+ role: resetPasswordRole,
},
element: (
),
},
{
- path: 'password_reset_confirm/:token',
+ path: `${passwordResetConfirmPath}/:token`,
handle: {
- role: 'org.openedx.frontend.role.confirmPassword',
+ role: confirmPasswordRole,
},
element: (
),
},
{
- path: 'welcome',
+ path: welcomePath,
handle: {
- role: 'org.openedx.frontend.role.welcome',
+ role: welcomeRole,
},
element: (
),
},
{
- path: 'notfound',
+ path: notFoundPath,
element: (
),