Skip to content

Commit 1877e1c

Browse files
committed
working through tests more
1 parent 1082ec3 commit 1877e1c

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

frontends/main/src/app-pages/DashboardPage/OrganizationContent.test.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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 () => {

frontends/main/src/app-pages/DashboardPage/OrganizationContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ const OrgProgramDisplay: React.FC<{
301301
</ProgramCertificateButton>
302302
)}
303303
</ProgramHeader>
304-
<PlainList>
304+
<PlainList data-test-id="org-program-courses-list">
305305
{transform
306306
.sortDashboardCourses(program, transformedCourses)
307307
.map((course) => (

0 commit comments

Comments
 (0)