diff --git a/src/forms/login-popup/components/AccountActivationMessage.jsx b/src/forms/login-popup/components/AccountActivationMessage.jsx index 7eeaa1cb..7049e524 100644 --- a/src/forms/login-popup/components/AccountActivationMessage.jsx +++ b/src/forms/login-popup/components/AccountActivationMessage.jsx @@ -24,7 +24,6 @@ const AccountActivationMessage = ({ messageType = null }) => { } const variant = messageType === ACCOUNT_ACTIVATION_MESSAGE.ERROR ? 'danger' : messageType; - const activationOrConfirmation = 'Confirmation'; const iconMapping = { [ACCOUNT_ACTIVATION_MESSAGE.SUCCESS]: CheckCircle, [ACCOUNT_ACTIVATION_MESSAGE.ERROR]: Error, @@ -34,22 +33,22 @@ const AccountActivationMessage = ({ messageType = null }) => { let heading; switch (messageType) { case ACCOUNT_ACTIVATION_MESSAGE.SUCCESS: { - heading = formatMessage(messages[`account${activationOrConfirmation}SuccessMessageTitle`]); - activationMessage = {formatMessage(messages[`account${activationOrConfirmation}SuccessMessage`])}; + heading = formatMessage(messages.accountConfirmationSuccessMessageTitle); + activationMessage = {formatMessage(messages.accountConfirmationSuccessMessage)}; break; } case ACCOUNT_ACTIVATION_MESSAGE.INFO: { - activationMessage = formatMessage(messages[`account${activationOrConfirmation}InfoMessage`]); + activationMessage = formatMessage(messages.accountConfirmationInfoMessage); break; } case ACCOUNT_ACTIVATION_MESSAGE.ERROR: { const supportLink = ( - {formatMessage(messages.accountActivationSupportLink)} + {formatMessage(messages.accountConfirmationSupportLink)} ); - heading = formatMessage(messages[`account${activationOrConfirmation}ErrorMessageTitle`]); + heading = formatMessage(messages.accountConfirmationErrorMessageTitle); activationMessage = ( { - beforeEach(() => { - mergeConfig({ - MARKETING_EMAILS_OPT_IN: '', - }); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('should match account already activated message', () => { - render( - - - , - ); - - const expectedMessage = 'This email has already been confirmed.'; - - expect(screen.getByText( - '', - { selector: '#account-activation-message' }, - ).textContent).toBe(expectedMessage); - }); - - it('should match account activated success message', () => { - render( - - - , - ); - - const expectedMessage = 'Success! You have confirmed your email.Sign in to continue.'; - - expect(screen.getByText( - '', - { selector: '#account-activation-message' }, - ).textContent).toBe(expectedMessage); - }); - - it('should match account activation error message', () => { - render( - - - , - ); - - const expectedMessage = 'Your email could not be confirmed' - + 'Something went wrong, please contact support to resolve this issue.'; - - expect(screen.getByText( - '', - { selector: '#account-activation-message' }, - ).textContent).toBe(expectedMessage); - }); - - it('should not display anything for invalid message type', () => { - const { container } = render( - - - , - ); - - const accountActivationMessage = container.querySelectorAll('#account-activation-message'); - expect(accountActivationMessage[0]).toBe(undefined); - }); -}); - describe('EmailConfirmationMessage', () => { beforeEach(() => { mergeConfig({ diff --git a/src/forms/login-popup/messages.js b/src/forms/login-popup/messages.js index eceb63fa..fbb8b566 100644 --- a/src/forms/login-popup/messages.js +++ b/src/forms/login-popup/messages.js @@ -159,32 +159,6 @@ const messages = defineMessages({ + 'Thank you for helping us keep your data safe.', description: 'Error message for non-compliant password', }, - // Account Activation Strings - accountActivationSuccessMessageTitle: { - id: 'account.activation.success.message.title', - defaultMessage: 'Success! You have activated your account.', - description: 'Account Activation success message title', - }, - accountActivationSuccessMessage: { - id: 'account.activation.success.message', - defaultMessage: 'You will now receive email updates and alerts from us related to the courses you are enrolled in. Sign in to continue.', - description: 'Message show to learners when their account has been activated successfully', - }, - accountActivationInfoMessage: { - id: 'account.activation.info.message', - defaultMessage: 'This account has already been activated.', - description: 'Message shown when learner account has already been activated', - }, - accountActivationErrorMessageTitle: { - id: 'account.activation.error.message.title', - defaultMessage: 'Your account could not be activated', - description: 'Account Activation error message title', - }, - accountActivationSupportLink: { - id: 'account.activation.support.link', - defaultMessage: 'contact support', - description: 'Link text used in account activation error message to go to learner help center', - }, // Email Confirmation Strings accountConfirmationSuccessMessageTitle: { id: 'account.confirmation.success.message.title', @@ -206,6 +180,11 @@ const messages = defineMessages({ defaultMessage: 'Your email could not be confirmed', description: 'Account verification error message title', }, + accountConfirmationSupportLink: { + id: 'account.confirmation.support.link', + defaultMessage: 'contact support', + description: 'Link text used in account confirmation error message to go to learner help center', + }, }); export default messages;