diff --git a/webapp/channels/src/components/password_reset_send_link/__snapshots__/password_reset_send_link.test.tsx.snap b/webapp/channels/src/components/password_reset_send_link/__snapshots__/password_reset_send_link.test.tsx.snap index 4f7cddc88d..c19deb3212 100644 --- a/webapp/channels/src/components/password_reset_send_link/__snapshots__/password_reset_send_link.test.tsx.snap +++ b/webapp/channels/src/components/password_reset_send_link/__snapshots__/password_reset_send_link.test.tsx.snap @@ -28,17 +28,11 @@ exports[`components/PasswordResetSendLink should match snapshot 1`] = `
- diff --git a/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.test.tsx b/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.test.tsx index 54d3fb5df9..8c947a3da2 100644 --- a/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.test.tsx +++ b/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.test.tsx @@ -5,15 +5,18 @@ import {shallow} from 'enzyme'; import React from 'react'; import {MemoryRouter} from 'react-router-dom'; -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; +import {mountWithIntl, type MockIntl} from 'tests/helpers/intl-test-helper'; -import PasswordResetSendLink from './password_reset_send_link'; +import {PasswordResetSendLink} from './password_reset_send_link'; describe('components/PasswordResetSendLink', () => { const baseProps = { actions: { sendPasswordResetEmail: jest.fn().mockResolvedValue({data: true}), }, + intl: { + formatMessage: jest.fn(), + } as MockIntl, }; it('should match snapshot', () => { diff --git a/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.tsx b/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.tsx index b036267ccf..f6379e47de 100644 --- a/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.tsx +++ b/webapp/channels/src/components/password_reset_send_link/password_reset_send_link.tsx @@ -2,21 +2,19 @@ // See LICENSE.txt for license information. import React from 'react'; -import {FormattedMessage} from 'react-intl'; +import {FormattedMessage, injectIntl, type IntlShape} from 'react-intl'; import type {ServerError} from '@mattermost/types/errors'; import {isEmail} from 'mattermost-redux/utils/helpers'; import BackButton from 'components/common/back_button'; -import LocalizedInput from 'components/localized_input/localized_input'; - -import {t} from 'utils/i18n'; interface Props { actions: { sendPasswordResetEmail: (email: string) => Promise<{data: any; error: ServerError}>; }; + intl: IntlShape; } interface State { @@ -24,7 +22,7 @@ interface State { updateText: React.ReactNode; } -export default class PasswordResetSendLink extends React.PureComponent { +export class PasswordResetSendLink extends React.PureComponent { state = { error: null, updateText: null, @@ -123,15 +121,15 @@ export default class PasswordResetSendLink extends React.PureComponent

- (elem }, ); } + +export interface MockIntl extends IntlShape { + formatMessage: jest.Mock; +}