@@ -144,33 +144,38 @@ describe("OrganizationContent", () => {
144144 { results : coursesB } ,
145145 )
146146
147- console . log ( coursesA , coursesB )
148-
149147 renderWithProviders ( < OrganizationContent orgSlug = { orgX . slug } /> )
150148
151149 const collectionHeader = await screen . findByRole ( "heading" , {
152150 name : programCollection . title ,
153151 } )
152+
154153 expect ( collectionHeader ) . toBeInTheDocument ( )
154+
155+ await waitFor ( async ( ) => {
156+ expect ( ( await screen . findAllByTestId ( "org-program-collection-root" ) ) . length ) . toBeGreaterThan ( 0 )
157+ } )
155158 const collectionItems = await screen . findAllByTestId (
156159 "org-program-collection-root" ,
157160 )
161+
158162 expect ( collectionItems . length ) . toBe ( 1 )
159163 const collection = within ( collectionItems [ 0 ] )
160164 expect ( collection . getByText ( programCollection . title ) ) . toBeInTheDocument ( )
161- console . log ( collectionItems [ 0 ] )
165+
166+ expect ( await collection . findAllByText ( coursesA [ 0 ] . title ) ) . toBeGreaterThan ( 50 )
162167
163168 // 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+ // })
174179 } )
175180
176181 test ( "Does not render a program separately if it is part of a collection" , async ( ) => {
0 commit comments