1- import React from 'react' ;
21import { Provider } from 'react-redux' ;
32
43import { mergeConfig } from '@edx/frontend-platform' ;
5- import { configure , injectIntl , IntlProvider } from '@edx/frontend-platform/i18n' ;
4+ import { configure , IntlProvider } from '@edx/frontend-platform/i18n' ;
65import {
76 fireEvent , render , screen ,
87} from '@testing-library/react' ;
@@ -26,7 +25,6 @@ jest.mock('react-router-dom', () => ({
2625 useNavigate : ( ) => mockedNavigator ,
2726} ) ) ;
2827
29- const IntlForgotPasswordPage = injectIntl ( ForgotPasswordPage ) ;
3028const mockStore = configureStore ( ) ;
3129
3230const initialState = {
@@ -78,7 +76,7 @@ describe('ForgotPasswordPage', () => {
7876 ) ;
7977
8078 it ( 'not should display need other help signing in button' , ( ) => {
81- const { queryByTestId } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
79+ const { queryByTestId } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
8280 const forgotPasswordButton = queryByTestId ( 'forgot-password' ) ;
8381 expect ( forgotPasswordButton ) . toBeNull ( ) ;
8482 } ) ;
@@ -87,14 +85,14 @@ describe('ForgotPasswordPage', () => {
8785 mergeConfig ( {
8886 LOGIN_ISSUE_SUPPORT_LINK : '/support' ,
8987 } ) ;
90- render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
88+ render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
9189 const forgotPasswordButton = screen . findByText ( 'Need help signing in?' ) ;
9290 expect ( forgotPasswordButton ) . toBeDefined ( ) ;
9391 } ) ;
9492
9593 it ( 'should display email validation error message' , async ( ) => {
9694 const validationMessage = 'We were unable to contact you.Enter a valid email address below.' ;
97- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
95+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
9896
9997 const emailInput = screen . getByLabelText ( 'Email' ) ;
10098
@@ -115,7 +113,7 @@ describe('ForgotPasswordPage', () => {
115113 const expectedMessage = 'We were unable to contact you.'
116114 + 'An error has occurred. Try refreshing the page, or check your internet connection.' ;
117115
118- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
116+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
119117
120118 const alertElements = container . querySelectorAll ( '.alert-danger' ) ;
121119 const validationErrors = alertElements [ 0 ] . textContent ;
@@ -124,7 +122,7 @@ describe('ForgotPasswordPage', () => {
124122
125123 it ( 'should display empty email validation message' , async ( ) => {
126124 const validationMessage = 'We were unable to contact you.Enter your email below.' ;
127- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
125+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
128126
129127 const submitButton = screen . getByText ( 'Submit' ) ;
130128 fireEvent . click ( submitButton ) ;
@@ -141,15 +139,15 @@ describe('ForgotPasswordPage', () => {
141139 forgotPassword : { status : 'forbidden' } ,
142140 } ) ;
143141
144- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
142+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
145143
146144 const alertElements = container . querySelectorAll ( '.alert-danger' ) ;
147145 const validationErrors = alertElements [ 0 ] . textContent ;
148146 expect ( validationErrors ) . toBe ( rateLimitMessage ) ;
149147 } ) ;
150148
151149 it ( 'should not display any error message on change event' , ( ) => {
152- render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
150+ render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
153151
154152 const emailInput = screen . getByLabelText ( 'Email' ) ;
155153
@@ -172,7 +170,7 @@ describe('ForgotPasswordPage', () => {
172170 } ;
173171
174172 store . dispatch = jest . fn ( store . dispatch ) ;
175- render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
173+ render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
176174 const emailInput = screen . getByLabelText ( 'Email' ) ;
177175
178176 fireEvent . blur ( emailInput ) ;
@@ -187,7 +185,7 @@ describe('ForgotPasswordPage', () => {
187185 emailValidationError : validationMessage ,
188186 email : '' ,
189187 } ;
190- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
188+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
191189 const validationElement = container . querySelector ( '.pgn__form-text-invalid' ) ;
192190 expect ( validationElement . textContent ) . toEqual ( validationMessage ) ;
193191 } ) ;
@@ -205,7 +203,7 @@ describe('ForgotPasswordPage', () => {
205203
206204 store . dispatch = jest . fn ( store . dispatch ) ;
207205
208- render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
206+ render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
209207 const emailInput = screen . getByLabelText ( 'Email' ) ;
210208
211209 fireEvent . focus ( emailInput ) ;
@@ -219,7 +217,7 @@ describe('ForgotPasswordPage', () => {
219217 emailValidationError : '' ,
220218 email : '' ,
221219 } ;
222- render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
220+ render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
223221 const errorElement = screen . queryByTestId ( 'email-invalid-feedback' ) ;
224222 expect ( errorElement ) . toBeNull ( ) ;
225223 } ) ;
@@ -236,7 +234,7 @@ describe('ForgotPasswordPage', () => {
236234 + 'receive a password reset message after 1 minute, verify that you entered the correct email address,'
237235 + ' or check your spam folder. If you need further assistance, contact technical support.' ;
238236
239- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
237+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
240238 const successElement = findByTextContent ( container , successMessage ) ;
241239
242240 expect ( successElement ) . toBeDefined ( ) ;
@@ -254,15 +252,15 @@ describe('ForgotPasswordPage', () => {
254252 + 'This password reset link is invalid. It may have been used already. '
255253 + 'Enter your email below to receive a new link.' ;
256254
257- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
255+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
258256 const successElement = findByTextContent ( container , successMessage ) ;
259257
260258 expect ( successElement ) . toBeDefined ( ) ;
261259 expect ( successElement . textContent ) . toEqual ( successMessage ) ;
262260 } ) ;
263261
264262 it ( 'should redirect onto login page' , async ( ) => {
265- const { container } = render ( reduxWrapper ( < IntlForgotPasswordPage { ...props } /> ) ) ;
263+ const { container } = render ( reduxWrapper ( < ForgotPasswordPage { ...props } /> ) ) ;
266264
267265 const navElement = container . querySelector ( 'nav' ) ;
268266 const anchorElement = navElement . querySelector ( 'a' ) ;
0 commit comments