-
-
-
{intl.formatMessage(messages['reset.password'])}
-
{intl.formatMessage(messages['reset.password.page.instructions'])}
-
+
+
+
+ {intl.formatMessage(messages['reset.password.page.title'],
+ { siteName: getConfig().SITE_NAME })}
+
+
+
setKey(k)}>
+
+
+ { key && (
+
+ )}
+
+
+
+
{intl.formatMessage(messages['reset.password'])}
+
{intl.formatMessage(messages['reset.password.page.instructions'])}
+
+
-
+
);
}
return null;
diff --git a/src/reset-password/tests/ResetPasswordPage.test.jsx b/src/reset-password/tests/ResetPasswordPage.test.jsx
index 5f94c3ed..ce8ab709 100644
--- a/src/reset-password/tests/ResetPasswordPage.test.jsx
+++ b/src/reset-password/tests/ResetPasswordPage.test.jsx
@@ -9,7 +9,7 @@ import { createMemoryHistory } from 'history';
import * as auth from '@edx/frontend-platform/auth';
import CookiePolicyBanner from '@edx/frontend-component-cookie-policy-banner';
-import { IntlProvider, injectIntl } from '@edx/frontend-platform/i18n';
+import { IntlProvider, injectIntl, configure } from '@edx/frontend-platform/i18n';
import { resetPassword } from '../data/actions';
import { PASSWORD_RESET, TOKEN_STATE } from '../data/constants';
@@ -36,6 +36,14 @@ describe('ResetPasswordPage', () => {
beforeEach(() => {
store = mockStore();
+ configure({
+ loggingService: { logError: jest.fn() },
+ config: {
+ ENVIRONMENT: 'production',
+ LANGUAGE_PREFERENCE_COOKIE_NAME: 'yum',
+ },
+ messages: { 'es-419': {}, de: {}, 'en-us': {} },
+ });
props = {
resetPassword: jest.fn(),
status: null,
diff --git a/src/welcome/WelcomePage.jsx b/src/welcome/WelcomePage.jsx
index 6f466aa8..21526e79 100644
--- a/src/welcome/WelcomePage.jsx
+++ b/src/welcome/WelcomePage.jsx
@@ -32,6 +32,7 @@ import { RedirectLogistration } from '../common-components';
import { DEFAULT_REDIRECT_URL, DEFAULT_STATE } from '../data/constants';
import { EDUCATION_LEVELS, GENDER_OPTIONS, YEAR_OF_BIRTH_OPTIONS } from '../register/data/constants';
import WelcomePageModal from './WelcomePageModal';
+import BaseComponent from '../base-component';
const WelcomePage = (props) => {
const { intl, submitState, showError } = props;
@@ -121,104 +122,106 @@ const WelcomePage = (props) => {
return (
<>
-
- {intl.formatMessage(messages['progressive.profiling.page.title'],
- { siteName: getConfig().SITE_NAME })}
-
-
-
- {props.shouldRedirect ? (
-
- ) : null}
-
-
-
{intl.formatMessage(messages['progressive.profiling.page.heading'])}
-
-
- {showError ? (
-
- {intl.formatMessage(messages['welcome.page.error.heading'])}
- {intl.formatMessage(messages['welcome.page.error.message'])}
-
+
+
+ {intl.formatMessage(messages['progressive.profiling.page.title'],
+ { siteName: getConfig().SITE_NAME })}
+
+
+
+ {props.shouldRedirect ? (
+
) : null}
-
- onChangeHandler(e)}
- trailingElement={}
- floatingLabel={intl.formatMessage(messages['education.levels.label'])}
- >
- {getOptions('levelOfEducation')}
-
-
-
- onChangeHandler(e)}
- trailingElement={}
- floatingLabel={intl.formatMessage(messages['year.of.birth.label'])}
- >
-
- {getOptions('yearOfBirth')}
-
-
-
- onChangeHandler(e)}
- trailingElement={}
- floatingLabel={intl.formatMessage(messages['gender.options.label'])}
- >
- {getOptions('gender')}
-
-
-
-
- {intl.formatMessage(messages['optional.fields.information.link'])}
-
-
-
-
e.preventDefault()}
- />
- e.preventDefault()}
- />
+
+
+
{intl.formatMessage(messages['progressive.profiling.page.heading'])}
-
-
+
+ {showError ? (
+
+ {intl.formatMessage(messages['welcome.page.error.heading'])}
+ {intl.formatMessage(messages['welcome.page.error.message'])}
+
+ ) : null}
+
+ onChangeHandler(e)}
+ trailingElement={}
+ floatingLabel={intl.formatMessage(messages['education.levels.label'])}
+ >
+ {getOptions('levelOfEducation')}
+
+
+
+ onChangeHandler(e)}
+ trailingElement={}
+ floatingLabel={intl.formatMessage(messages['year.of.birth.label'])}
+ >
+
+ {getOptions('yearOfBirth')}
+
+
+
+ onChangeHandler(e)}
+ trailingElement={}
+ floatingLabel={intl.formatMessage(messages['gender.options.label'])}
+ >
+ {getOptions('gender')}
+
+
+
+
+ {intl.formatMessage(messages['optional.fields.information.link'])}
+
+
+
+ e.preventDefault()}
+ />
+ e.preventDefault()}
+ />
+
+
+
+
>
);
};
diff --git a/src/welcome/tests/WelcomePage.test.jsx b/src/welcome/tests/WelcomePage.test.jsx
index ec803649..d83bfdc2 100644
--- a/src/welcome/tests/WelcomePage.test.jsx
+++ b/src/welcome/tests/WelcomePage.test.jsx
@@ -8,7 +8,7 @@ import configureStore from 'redux-mock-store';
import { mergeConfig } from '@edx/frontend-platform';
import * as analytics from '@edx/frontend-platform/analytics';
import * as auth from '@edx/frontend-platform/auth';
-import { injectIntl, IntlProvider } from '@edx/frontend-platform/i18n';
+import { injectIntl, IntlProvider, configure } from '@edx/frontend-platform/i18n';
import { saveUserProfile } from '../data/actions';
import WelcomePage from '../WelcomePage';
@@ -50,6 +50,14 @@ describe('WelcomePageTests', () => {
beforeEach(() => {
store = mockStore({});
auth.getAuthenticatedUser = jest.fn(() => ({ userId: 3, username: 'edX' }));
+ configure({
+ loggingService: { logError: jest.fn() },
+ config: {
+ ENVIRONMENT: 'production',
+ LANGUAGE_PREFERENCE_COOKIE_NAME: 'yum',
+ },
+ messages: { 'es-419': {}, de: {}, 'en-us': {} },
+ });
});
it('should submit user profile details on form submission', async () => {