Skip to content

Commit ffcd0c3

Browse files
committed
test: Fix broken tests
1 parent 1905c13 commit ffcd0c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/course-libraries/CourseLibraries.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('<CourseLibraries />', () => {
8383
expect(reviewTab).toHaveAttribute('aria-selected', 'true');
8484

8585
await user.click(allTab);
86-
const alert = await screen.findByRole('alert');
86+
const alert = (await screen.findAllByRole('alert'))[0];
8787
expect(await within(alert).findByText(
8888
'5 library components are out of sync. Review updates to accept or ignore changes',
8989
)).toBeInTheDocument();
@@ -107,7 +107,7 @@ describe('<CourseLibraries />', () => {
107107
await user.click(allTab);
108108
expect(allTab).toHaveAttribute('aria-selected', 'true');
109109

110-
const alert = await screen.findByRole('alert');
110+
const alert = (await screen.findAllByRole('alert'))[0];
111111
expect(await within(alert).findByText(
112112
'5 library components are out of sync. Review updates to accept or ignore changes',
113113
)).toBeInTheDocument();
@@ -136,7 +136,7 @@ describe('<CourseLibraries />', () => {
136136
expect(reviewTab).toHaveAttribute('aria-selected', 'true');
137137

138138
await user.click(allTab);
139-
const alert = await screen.findByRole('alert');
139+
const alert = (await screen.findAllByRole('alert'))[0];
140140
expect(await within(alert).findByText(
141141
'5 library components are out of sync. Review updates to accept or ignore changes',
142142
)).toBeInTheDocument();
@@ -160,7 +160,7 @@ describe('<CourseLibraries />', () => {
160160

161161
screen.logTestingPlaygroundURL();
162162

163-
expect(screen.queryByRole('alert')).not.toBeInTheDocument();
163+
expect(screen.queryAllByRole('alert').length).toEqual(1);
164164
});
165165
});
166166

0 commit comments

Comments
 (0)