Skip to content

Commit ff72dab

Browse files
chore(deps): update @openedx dependencies to versions that support React 18 (#758)
1 parent c38887e commit ff72dab

File tree

7 files changed

+2867
-1584
lines changed

7 files changed

+2867
-1584
lines changed

package-lock.json

Lines changed: 2831 additions & 1546 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"lint:fix": "fedx-scripts eslint --ext .js --ext .jsx . --fix",
1717
"snapshot": "fedx-scripts jest --updateSnapshot",
1818
"start": "fedx-scripts webpack-dev-server --progress",
19+
"dev": "PUBLIC_PATH=/discussions/ MFE_CONFIG_API_URL='http://localhost:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",
1920
"test": "fedx-scripts jest --coverage --passWithNoTests"
2021
},
2122
"husky": {
@@ -34,11 +35,12 @@
3435
},
3536
"dependencies": {
3637
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
37-
"@edx/frontend-component-header": "^5.6.0",
38-
"@edx/frontend-platform": "8.0.0",
38+
"@edx/frontend-component-footer": "^14.3.0",
39+
"@edx/frontend-component-header": "^6.2.0",
40+
"@edx/frontend-platform": "^8.3.1",
3941
"@edx/openedx-atlas": "^0.6.0",
4042
"@openedx/frontend-slot-footer": "^1.0.2",
41-
"@openedx/paragon": "^22.1.1",
43+
"@openedx/paragon": "^22.16.0",
4244
"@reduxjs/toolkit": "1.9.7",
4345
"@tinymce/tinymce-react": "3.13.1",
4446
"babel-polyfill": "6.26.0",
@@ -64,7 +66,7 @@
6466
"devDependencies": {
6567
"@edx/browserslist-config": "1.2.0",
6668
"@edx/reactifex": "1.1.0",
67-
"@openedx/frontend-build": "14.0.3",
69+
"@openedx/frontend-build": "^14.3.3",
6870
"@testing-library/jest-dom": "5.17.0",
6971
"@testing-library/react": "12.1.5",
7072
"@testing-library/user-event": "13.5.0",

src/discussions/common/HoverCard.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ describe('HoverCard', () => {
106106
});
107107

108108
test('it should have hover card on post', async () => {
109-
await waitFor(() => renderComponent(discussionPostId));
110-
const post = screen.getByTestId('post-thread-1');
109+
renderComponent(discussionPostId);
110+
const post = await screen.findByTestId('post-thread-1');
111111
expect(within(post).getByTestId('hover-card-thread-1')).toBeInTheDocument();
112112
});
113113

src/discussions/discussions-home/DiscussionsHome.test.jsx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ describe('DiscussionsHome', () => {
9090

9191
test('full view should hide close button', async () => {
9292
renderComponent(`/${courseId}/topics`);
93-
expect(screen.queryByText(navigationBarMessages.allTopics.defaultMessage))
94-
.toBeInTheDocument();
93+
await screen.findByText(navigationBarMessages.allTopics.defaultMessage);
9594
expect(screen.queryByRole('button', { name: 'Close' }))
9695
.not
9796
.toBeInTheDocument();
@@ -144,9 +143,7 @@ describe('DiscussionsHome', () => {
144143
await executeThunk(fetchCourseConfig(courseId), store.dispatch, store.getState);
145144
await renderComponent(`/${courseId}/${searchByEndPoint}`);
146145

147-
waitFor(() => {
148-
expect(screen.queryByText('Add a post')).toBeInTheDocument();
149-
});
146+
await screen.findByText('Add a post');
150147
});
151148

152149
it.each([
@@ -170,9 +167,7 @@ describe('DiscussionsHome', () => {
170167
await executeThunk(fetchThreads(courseId), store.dispatch, store.getState);
171168
await renderComponent(`/${courseId}/${searchByEndPoint}`);
172169

173-
waitFor(() => {
174-
expect(screen.queryByText(result)).toBeInTheDocument();
175-
});
170+
await screen.findByText(result);
176171
});
177172

178173
it.each([
@@ -199,9 +194,7 @@ describe('DiscussionsHome', () => {
199194
await executeThunk(fetchCourseTopicsV3(courseId), store.dispatch, store.getState);
200195
await renderComponent(`/${courseId}/${searchByEndPoint}`);
201196

202-
waitFor(() => {
203-
expect(screen.queryByText('No topic selected')).toBeInTheDocument();
204-
});
197+
await screen.findByText('No topic selected');
205198
},
206199
);
207200

@@ -210,9 +203,7 @@ describe('DiscussionsHome', () => {
210203
await executeThunk(fetchCourseConfig(courseId), store.dispatch, store.getState);
211204
await renderComponent(`/${courseId}/learners`);
212205

213-
waitFor(() => {
214-
expect(screen.queryByText('Nothing here yet')).toBeInTheDocument();
215-
});
206+
await screen.findByText('Nothing here yet');
216207
});
217208

218209
it('should display post editor form when click on add a post button for posts', async () => {
@@ -235,10 +226,10 @@ describe('DiscussionsHome', () => {
235226
await executeThunk(fetchCourseConfig(courseId), store.dispatch, store.getState);
236227
await renderComponent(`/${courseId}/topics`);
237228

238-
await waitFor(() => expect(screen.queryByText('Nothing here yet')).toBeInTheDocument());
229+
await screen.findByText('Nothing here yet');
239230

240231
await act(async () => {
241-
fireEvent.click(screen.queryByText('Add a post'));
232+
fireEvent.click(await screen.findByText('Add a post'));
242233
});
243234

244235
await waitFor(() => expect(container.querySelector('.post-form')).toBeInTheDocument());
@@ -247,27 +238,27 @@ describe('DiscussionsHome', () => {
247238
it('should display Add a post button for legacy topics view', async () => {
248239
await renderComponent(`/${courseId}/topics/topic-1`);
249240

250-
await waitFor(() => expect(screen.queryByText('Add a post')).toBeInTheDocument());
241+
await screen.findByText('Add a post');
251242
});
252243

253244
it('should display No post selected for legacy topics view', async () => {
254245
await setUpV1TopicsMockResponse();
255246
await renderComponent(`/${courseId}/topics/category-1-topic-1`);
256247

257-
await waitFor(() => expect(screen.queryByText('No post selected')).toBeInTheDocument());
248+
await screen.findByText('No post selected');
258249
});
259250

260251
it('should display No topic selected for legacy topics view', async () => {
261252
await setUpV1TopicsMockResponse();
262253
await renderComponent(`/${courseId}/topics`);
263254

264-
await waitFor(() => expect(screen.queryByText('No topic selected')).toBeInTheDocument());
255+
await screen.findByText('No topic selected');
265256
});
266257

267258
it('should display navigation tabs', async () => {
268259
renderComponent(`/${courseId}/topics`);
269260

270-
await waitFor(() => expect(screen.queryByText('Discussion')).toBeInTheDocument());
261+
await screen.findByText('Discussion');
271262
});
272263

273264
it('should display content unavailable message when the user is not enrolled in the course.', async () => {
@@ -276,7 +267,7 @@ describe('DiscussionsHome', () => {
276267

277268
renderComponent();
278269

279-
await waitFor(() => expect(screen.queryByText('Content unavailable')).toBeInTheDocument());
270+
await screen.findByText('Content unavailable');
280271
});
281272

282273
it('should redirect to dashboard when the user clicks on the Enroll button.', async () => {

src/discussions/empty-posts/EmptyTopics.test.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,13 @@ describe('EmptyTopics', () => {
6666

6767
test('"no topic selected" text shown when viewing topics page', async () => {
6868
renderComponent(`/${courseId}/topics/`);
69-
expect(screen.queryByText(messages.emptyTitle.defaultMessage))
70-
.toBeInTheDocument();
69+
await screen.findByText(messages.emptyTitle.defaultMessage);
7170
});
7271

7372
test('"no post selected" text shown when viewing a specific topic', async () => {
7473
await setupMockResponse();
7574
renderComponent(`/${courseId}/topics/ncwtopic-3/`);
7675

77-
expect(screen.queryByText(messages.noPostSelected.defaultMessage))
78-
.toBeInTheDocument();
76+
await screen.findByText(messages.noPostSelected.defaultMessage);
7977
});
8078
});

src/discussions/in-context-topics/TopicPostsView.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ describe('InContext Topic Posts View', () => {
283283
await setupTopicsMockResponse(0, 0, 0);
284284
await renderComponent({ topicId: 'test-topic', category: 'test-category' });
285285

286-
await waitFor(() => expect(within(container).queryByText('Nothing here yet')).toBeInTheDocument());
287-
expect(within(container).queryByText('No topic exists')).toBeInTheDocument();
288-
expect(within(container).queryByText('Unnamed Topic')).toBeInTheDocument();
286+
await within(container).findByText('Nothing here yet');
287+
await within(container).findByText('No topic exists');
288+
await within(container).findByText('Unnamed Topic');
289289
},
290290
);
291291

src/discussions/in-context-topics/TopicsView.test.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
fireEvent, render, screen, waitFor,
33
within,
44
} from '@testing-library/react';
5+
import userEvent from '@testing-library/user-event';
56
import MockAdapter from 'axios-mock-adapter';
67
import { act } from 'react-dom/test-utils';
78
import { IntlProvider } from 'react-intl';
@@ -165,9 +166,10 @@ describe('InContext Topics View', () => {
165166
it('The subsection should have a title name, be clickable, and have the stats', async () => {
166167
await setupMockResponse();
167168
renderComponent();
169+
await screen.findByTestId('redux-provider');
168170
const subsectionObject = coursewareTopics[0].children[0];
169171
const subSection = await container.querySelector(`[data-subsection-id=${subsectionObject.id}]`);
170-
const subSectionTitle = await within(subSection).queryByText(subsectionObject.displayName);
172+
const subSectionTitle = await within(subSection).findByText(subsectionObject.displayName);
171173
const statsList = await subSection.querySelectorAll('.icon-size');
172174

173175
expect(subSectionTitle).toBeInTheDocument();
@@ -177,11 +179,12 @@ describe('InContext Topics View', () => {
177179
it('Subsection names should be clickable and redirected to the units lists', async () => {
178180
await setupMockResponse();
179181
renderComponent();
182+
await screen.findByTestId('redux-provider');
180183

181184
const subsectionObject = coursewareTopics[0].children[0];
182185
const subSection = await container.querySelector(`[data-subsection-id=${subsectionObject.id}]`);
183186

184-
await act(async () => { fireEvent.click(subSection); });
187+
await userEvent.click(subSection);
185188
await waitFor(async () => {
186189
const backButton = await screen.getByLabelText('Back to topics list');
187190
const topicsList = await screen.getByRole('list');
@@ -198,9 +201,11 @@ describe('InContext Topics View', () => {
198201
it('The number of units should be matched with the actual unit length.', async () => {
199202
await setupMockResponse();
200203
renderComponent();
204+
await screen.findByTestId('redux-provider');
205+
201206
const subSection = await container.querySelector(`[data-subsection-id=${coursewareTopics[0].children[0].id}]`);
202207

203-
await act(async () => { fireEvent.click(subSection); });
208+
await userEvent.click(subSection);
204209
await waitFor(async () => {
205210
const units = await container.querySelectorAll('.discussion-topic');
206211

@@ -211,12 +216,14 @@ describe('InContext Topics View', () => {
211216
it('A unit should have a title and should be clickable', async () => {
212217
await setupMockResponse();
213218
renderComponent();
219+
await screen.findByTestId('redux-provider');
220+
214221
const subSectionObject = coursewareTopics[0].children[0];
215222
const unitObject = subSectionObject.children[0];
216223

217224
const subSection = await container.querySelector(`[data-subsection-id=${subSectionObject.id}]`);
218225

219-
await act(async () => { fireEvent.click(subSection); });
226+
await userEvent.click(subSection);
220227
await waitFor(async () => {
221228
const unitElement = await screen.findByText(unitObject.name);
222229
const unitContainer = await container.querySelector(`[data-topic-id=${unitObject.id}]`);

0 commit comments

Comments
 (0)