@@ -144,33 +144,38 @@ describe("OrganizationContent", () => {
144
144
{ results : coursesB } ,
145
145
)
146
146
147
- console . log ( coursesA , coursesB )
148
-
149
147
renderWithProviders ( < OrganizationContent orgSlug = { orgX . slug } /> )
150
148
151
149
const collectionHeader = await screen . findByRole ( "heading" , {
152
150
name : programCollection . title ,
153
151
} )
152
+
154
153
expect ( collectionHeader ) . toBeInTheDocument ( )
154
+
155
+ await waitFor ( async ( ) => {
156
+ expect ( ( await screen . findAllByTestId ( "org-program-collection-root" ) ) . length ) . toBeGreaterThan ( 0 )
157
+ } )
155
158
const collectionItems = await screen . findAllByTestId (
156
159
"org-program-collection-root" ,
157
160
)
161
+
158
162
expect ( collectionItems . length ) . toBe ( 1 )
159
163
const collection = within ( collectionItems [ 0 ] )
160
164
expect ( collection . getByText ( programCollection . title ) ) . toBeInTheDocument ( )
161
- console . log ( collectionItems [ 0 ] )
165
+
166
+ expect ( await collection . findAllByText ( coursesA [ 0 ] . title ) ) . toBeGreaterThan ( 50 )
162
167
163
168
// Wait for the course data to load and check that courses are displayed
164
- await waitFor ( ( ) => {
165
- expect ( collection . getAllByText ( coursesA [ 0 ] . title ) . length ) . toBeGreaterThan (
166
- 0 ,
167
- )
168
- } )
169
- await waitFor ( ( ) => {
170
- expect ( collection . getAllByText ( coursesB [ 0 ] . title ) . length ) . toBeGreaterThan (
171
- 0 ,
172
- )
173
- } )
169
+ // await waitFor(() => {
170
+ // expect(collection.getAllByText(coursesA[0].title).length).toBeGreaterThan(
171
+ // 0,
172
+ // )
173
+ // })
174
+ // await waitFor(() => {
175
+ // expect(collection.getAllByText(coursesB[0].title).length).toBeGreaterThan(
176
+ // 0,
177
+ // )
178
+ // })
174
179
} )
175
180
176
181
test ( "Does not render a program separately if it is part of a collection" , async ( ) => {
0 commit comments