@@ -3,6 +3,7 @@ import { render } from '@testing-library/react';
33import { Provider } from 'react-redux' ;
44import configureStore from 'redux-mock-store' ;
55import { MemoryRouter } from 'react-router-dom' ;
6+ import { IntlProvider } from 'react-intl' ;
67import CreateCoursePage from './index' ;
78import { courseOptions , courseRunOptions } from '../../data/constants/testData' ;
89
@@ -16,7 +17,9 @@ describe('CreateCoursePage', () => {
1617 const { container } = render (
1718 < Provider store = { store } >
1819 < MemoryRouter >
19- < CreateCoursePage courseOptions = { courseOptions } courseRunOptions = { courseRunOptions } />
20+ < IntlProvider locale = "en" messages = { { } } >
21+ < CreateCoursePage courseOptions = { courseOptions } courseRunOptions = { courseRunOptions } />
22+ </ IntlProvider >
2023 </ MemoryRouter >
2124 </ Provider > ,
2225 ) ;
@@ -27,27 +30,29 @@ describe('CreateCoursePage', () => {
2730 const { container } = render (
2831 < Provider store = { store } >
2932 < MemoryRouter >
30- < CreateCoursePage
31- courseOptions = { courseOptions }
32- courseRunOptions = { courseRunOptions }
33- fetchOrganizations = { ( ) => null }
34- publisherUserInfo = { {
35- organizations : [ ] ,
36- error : null ,
37- isFetching : true ,
38- } }
39- productSourceOptions = { {
40- productSources : [ ] ,
41- error : null ,
42- isFetching : true ,
43- } }
44- courseInfo = { {
45- error : null ,
46- isCreating : false ,
47- data : { } ,
48- } }
49- createCourse = { ( ) => null }
50- />
33+ < IntlProvider locale = "en" messages = { { } } >
34+ < CreateCoursePage
35+ courseOptions = { courseOptions }
36+ courseRunOptions = { courseRunOptions }
37+ fetchOrganizations = { ( ) => null }
38+ publisherUserInfo = { {
39+ organizations : [ ] ,
40+ error : null ,
41+ isFetching : true ,
42+ } }
43+ productSourceOptions = { {
44+ productSources : [ ] ,
45+ error : null ,
46+ isFetching : true ,
47+ } }
48+ courseInfo = { {
49+ error : null ,
50+ isCreating : false ,
51+ data : { } ,
52+ } }
53+ createCourse = { ( ) => null }
54+ />
55+ </ IntlProvider >
5156 </ MemoryRouter >
5257 </ Provider > ,
5358 ) ;
@@ -58,27 +63,29 @@ describe('CreateCoursePage', () => {
5863 const { container } = render (
5964 < Provider store = { store } >
6065 < MemoryRouter >
61- < CreateCoursePage
62- courseOptions = { courseOptions }
63- courseRunOptions = { courseRunOptions }
64- fetchOrganizations = { ( ) => null }
65- publisherUserInfo = { {
66- organizations,
67- error : null ,
68- isFetching : false ,
69- } }
70- productSourceOptions = { {
71- productSources : sources ,
72- error : null ,
73- isFetching : false ,
74- } }
75- courseInfo = { {
76- error : null ,
77- isCreating : false ,
78- data : { } ,
79- } }
80- createCourse = { ( ) => null }
81- />
66+ < IntlProvider locale = "en" messages = { { } } >
67+ < CreateCoursePage
68+ courseOptions = { courseOptions }
69+ courseRunOptions = { courseRunOptions }
70+ fetchOrganizations = { ( ) => null }
71+ publisherUserInfo = { {
72+ organizations,
73+ error : null ,
74+ isFetching : false ,
75+ } }
76+ productSourceOptions = { {
77+ productSources : sources ,
78+ error : null ,
79+ isFetching : false ,
80+ } }
81+ courseInfo = { {
82+ error : null ,
83+ isCreating : false ,
84+ data : { } ,
85+ } }
86+ createCourse = { ( ) => null }
87+ />
88+ </ IntlProvider >
8289 </ MemoryRouter >
8390 </ Provider > ,
8491 ) ;
@@ -89,22 +96,24 @@ describe('CreateCoursePage', () => {
8996 const { container } = render (
9097 < Provider store = { store } >
9198 < MemoryRouter >
92- < CreateCoursePage
93- courseOptions = { courseOptions }
94- courseRunOptions = { courseRunOptions }
95- fetchOrganizations = { ( ) => null }
96- publisherUserInfo = { {
97- organizations,
98- error : [ 'Fail' ] ,
99- isFetching : false ,
100- } }
101- courseInfo = { {
102- error : null ,
103- isCreating : false ,
104- data : { } ,
105- } }
106- createCourse = { ( ) => null }
107- />
99+ < IntlProvider locale = "en" messages = { { } } >
100+ < CreateCoursePage
101+ courseOptions = { courseOptions }
102+ courseRunOptions = { courseRunOptions }
103+ fetchOrganizations = { ( ) => null }
104+ publisherUserInfo = { {
105+ organizations,
106+ error : [ 'Fail' ] ,
107+ isFetching : false ,
108+ } }
109+ courseInfo = { {
110+ error : null ,
111+ isCreating : false ,
112+ data : { } ,
113+ } }
114+ createCourse = { ( ) => null }
115+ />
116+ </ IntlProvider >
108117 </ MemoryRouter >
109118 </ Provider > ,
110119 ) ;
@@ -114,18 +123,20 @@ describe('CreateCoursePage', () => {
114123 const { container } = render (
115124 < Provider store = { store } >
116125 < MemoryRouter >
117- < CreateCoursePage
118- courseOptions = { courseOptions }
119- courseRunOptions = { courseRunOptions }
120- fetchOrganizations = { ( ) => null }
121- courseInfo = { {
122- error : null ,
123- isCreating : false ,
124- data : { } ,
125- } }
126- createCourse = { ( ) => null }
127- publisherUserInfo = { null }
128- />
126+ < IntlProvider locale = "en" messages = { { } } >
127+ < CreateCoursePage
128+ courseOptions = { courseOptions }
129+ courseRunOptions = { courseRunOptions }
130+ fetchOrganizations = { ( ) => null }
131+ courseInfo = { {
132+ error : null ,
133+ isCreating : false ,
134+ data : { } ,
135+ } }
136+ createCourse = { ( ) => null }
137+ publisherUserInfo = { null }
138+ />
139+ </ IntlProvider >
129140 </ MemoryRouter >
130141 </ Provider > ,
131142 ) ;
@@ -135,22 +146,24 @@ describe('CreateCoursePage', () => {
135146 const { container } = render (
136147 < Provider store = { store } >
137148 < MemoryRouter >
138- < CreateCoursePage
139- courseOptions = { courseOptions }
140- courseRunOptions = { courseRunOptions }
141- fetchOrganizations = { ( ) => null }
142- publisherUserInfo = { {
143- organizations,
144- error : null ,
145- isFetching : false ,
146- } }
147- courseInfo = { {
148- error : [ 'Fail' ] ,
149- isCreating : false ,
150- data : { } ,
151- } }
152- createCourse = { ( ) => null }
153- />
149+ < IntlProvider locale = "en" messages = { { } } >
150+ < CreateCoursePage
151+ courseOptions = { courseOptions }
152+ courseRunOptions = { courseRunOptions }
153+ fetchOrganizations = { ( ) => null }
154+ publisherUserInfo = { {
155+ organizations,
156+ error : null ,
157+ isFetching : false ,
158+ } }
159+ courseInfo = { {
160+ error : [ 'Fail' ] ,
161+ isCreating : false ,
162+ data : { } ,
163+ } }
164+ createCourse = { ( ) => null }
165+ />
166+ </ IntlProvider >
154167 </ MemoryRouter >
155168 </ Provider > ,
156169 ) ;
@@ -160,24 +173,26 @@ describe('CreateCoursePage', () => {
160173 const { container } = render (
161174 < Provider store = { store } >
162175 < MemoryRouter >
163- < CreateCoursePage
164- courseOptions = { courseOptions }
165- courseRunOptions = { courseRunOptions }
166- fetchOrganizations = { ( ) => null }
167- publisherUserInfo = { {
168- organizations,
169- error : null ,
170- isFetching : false ,
171- } }
172- courseInfo = { {
173- error : null ,
174- isCreating : false ,
175- data : {
176- uuid : '11111111-1111-1111-1111-111111111111' ,
177- } ,
178- } }
179- createCourse = { ( ) => null }
180- />
176+ < IntlProvider locale = "en" messages = { { } } >
177+ < CreateCoursePage
178+ courseOptions = { courseOptions }
179+ courseRunOptions = { courseRunOptions }
180+ fetchOrganizations = { ( ) => null }
181+ publisherUserInfo = { {
182+ organizations,
183+ error : null ,
184+ isFetching : false ,
185+ } }
186+ courseInfo = { {
187+ error : null ,
188+ isCreating : false ,
189+ data : {
190+ uuid : '11111111-1111-1111-1111-111111111111' ,
191+ } ,
192+ } }
193+ createCourse = { ( ) => null }
194+ />
195+ </ IntlProvider >
181196 </ MemoryRouter >
182197 </ Provider > ,
183198 ) ;
@@ -187,24 +202,26 @@ describe('CreateCoursePage', () => {
187202 const { container } = render (
188203 < Provider store = { store } >
189204 < MemoryRouter >
190- < CreateCoursePage
191- courseOptions = { courseOptions }
192- courseRunOptions = { courseRunOptions }
193- fetchOrganizations = { ( ) => null }
194- publisherUserInfo = { {
195- organizations,
196- error : null ,
197- isFetching : false ,
198- } }
199- courseInfo = { {
200- error : null ,
201- isCreating : true ,
202- data : {
203- uuid : '11111111-1111-1111-1111-111111111111' ,
204- } ,
205- } }
206- createCourse = { ( ) => null }
207- />
205+ < IntlProvider locale = "en" messages = { { } } >
206+ < CreateCoursePage
207+ courseOptions = { courseOptions }
208+ courseRunOptions = { courseRunOptions }
209+ fetchOrganizations = { ( ) => null }
210+ publisherUserInfo = { {
211+ organizations,
212+ error : null ,
213+ isFetching : false ,
214+ } }
215+ courseInfo = { {
216+ error : null ,
217+ isCreating : true ,
218+ data : {
219+ uuid : '11111111-1111-1111-1111-111111111111' ,
220+ } ,
221+ } }
222+ createCourse = { ( ) => null }
223+ />
224+ </ IntlProvider >
208225 </ MemoryRouter >
209226 </ Provider > ,
210227 ) ;
0 commit comments