Skip to content

Commit cba85ab

Browse files
authored
test: fix flaky library-authoring test (#1193)
1 parent cc3bbfd commit cba85ab

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/library-authoring/LibraryAuthoringPage.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ describe('<LibraryAuthoringPage />', () => {
313313
expect(getByText('Content library')).toBeInTheDocument();
314314
expect(getByText(libraryData.title)).toBeInTheDocument();
315315

316-
expect(getByText('Recently Modified')).toBeInTheDocument();
316+
await waitFor(() => { expect(getByText('Recently Modified')).toBeInTheDocument(); });
317317
expect(getByText('Collections (0)')).toBeInTheDocument();
318318
expect(getByText('Components (6)')).toBeInTheDocument();
319319
expect(getAllByText('Test HTML Block')[0]).toBeInTheDocument();
@@ -355,11 +355,10 @@ describe('<LibraryAuthoringPage />', () => {
355355
expect(getByText('Content library')).toBeInTheDocument();
356356
expect(getByText(libraryData.title)).toBeInTheDocument();
357357

358-
expect(getByText('Recently Modified')).toBeInTheDocument();
358+
await waitFor(() => { expect(getByText('Recently Modified')).toBeInTheDocument(); });
359359
expect(getByText('Collections (0)')).toBeInTheDocument();
360360
expect(getByText('Components (2)')).toBeInTheDocument();
361361
expect(getAllByText('Test HTML Block')[0]).toBeInTheDocument();
362-
363362
expect(queryByText('You have not added any content to this library yet.')).not.toBeInTheDocument();
364363

365364
// There should not be any "View All" button on page since Components count

0 commit comments

Comments
 (0)