@@ -83,7 +83,7 @@ describe('<CourseLibraries />', () => {
83
83
expect ( reviewTab ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
84
84
85
85
await user . click ( allTab ) ;
86
- const alert = await screen . findByRole ( 'alert' ) ;
86
+ const alert = ( await screen . findAllByRole ( 'alert' ) ) [ 0 ] ;
87
87
expect ( await within ( alert ) . findByText (
88
88
'5 library components are out of sync. Review updates to accept or ignore changes' ,
89
89
) ) . toBeInTheDocument ( ) ;
@@ -107,7 +107,7 @@ describe('<CourseLibraries />', () => {
107
107
await user . click ( allTab ) ;
108
108
expect ( allTab ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
109
109
110
- const alert = await screen . findByRole ( 'alert' ) ;
110
+ const alert = ( await screen . findAllByRole ( 'alert' ) ) [ 0 ] ;
111
111
expect ( await within ( alert ) . findByText (
112
112
'5 library components are out of sync. Review updates to accept or ignore changes' ,
113
113
) ) . toBeInTheDocument ( ) ;
@@ -136,7 +136,7 @@ describe('<CourseLibraries />', () => {
136
136
expect ( reviewTab ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
137
137
138
138
await user . click ( allTab ) ;
139
- const alert = await screen . findByRole ( 'alert' ) ;
139
+ const alert = ( await screen . findAllByRole ( 'alert' ) ) [ 0 ] ;
140
140
expect ( await within ( alert ) . findByText (
141
141
'5 library components are out of sync. Review updates to accept or ignore changes' ,
142
142
) ) . toBeInTheDocument ( ) ;
@@ -160,7 +160,7 @@ describe('<CourseLibraries />', () => {
160
160
161
161
screen . logTestingPlaygroundURL ( ) ;
162
162
163
- expect ( screen . queryByRole ( 'alert' ) ) . not . toBeInTheDocument ( ) ;
163
+ expect ( screen . queryAllByRole ( 'alert' ) . length ) . toEqual ( 1 ) ;
164
164
} ) ;
165
165
} ) ;
166
166
0 commit comments