- Mocked EnrollmentDisplay with programId: {programId}
+jest.mock("./CoursewareDisplay/ProgramEnrollmentDisplay", () => ({
+ ProgramEnrollmentDisplay: jest.fn(({ programId }) => (
+
+ Mocked ProgramEnrollmentDisplay with programId: {programId}
)),
}))
describe("ProgramContent", () => {
- test("renders EnrollmentDisplay with programId prop", () => {
+ test("renders ProgramEnrollmentDisplay with programId prop", () => {
const programId = 123
renderWithProviders(
)
- const enrollmentDisplay = screen.getByTestId("enrollment-display")
- expect(enrollmentDisplay).toBeInTheDocument()
- expect(enrollmentDisplay).toHaveAttribute("data-program-id", "123")
+ const programEnrollmentDisplay = screen.getByTestId(
+ "program-enrollment-display",
+ )
+ expect(programEnrollmentDisplay).toBeInTheDocument()
+ expect(programEnrollmentDisplay).toHaveAttribute("data-program-id", "123")
})
- test("passes correct programId to EnrollmentDisplay", () => {
+ test("passes correct programId to ProgramEnrollmentDisplay", () => {
const programId = 456
renderWithProviders(
)
expect(
- screen.getByText(`Mocked EnrollmentDisplay with programId: ${programId}`),
+ screen.getByText(
+ `Mocked ProgramEnrollmentDisplay with programId: ${programId}`,
+ ),
).toBeInTheDocument()
})
test("handles different programId values", () => {
const { view } = renderWithProviders(
)
- expect(screen.getByTestId("enrollment-display")).toHaveAttribute(
+ expect(screen.getByTestId("program-enrollment-display")).toHaveAttribute(
"data-program-id",
"1",
)
view.rerender(
)
- expect(screen.getByTestId("enrollment-display")).toHaveAttribute(
+ expect(screen.getByTestId("program-enrollment-display")).toHaveAttribute(
"data-program-id",
"999",
)
diff --git a/frontends/main/src/app-pages/DashboardPage/ProgramContent.tsx b/frontends/main/src/app-pages/DashboardPage/ProgramContent.tsx
index 3737564948..5d0388233d 100644
--- a/frontends/main/src/app-pages/DashboardPage/ProgramContent.tsx
+++ b/frontends/main/src/app-pages/DashboardPage/ProgramContent.tsx
@@ -1,14 +1,14 @@
"use client"
import React from "react"
-import { EnrollmentDisplay } from "./CoursewareDisplay/EnrollmentDisplay"
+import { ProgramEnrollmentDisplay } from "./CoursewareDisplay/ProgramEnrollmentDisplay"
interface ProgramContentProps {
programId: number
}
const ProgramContent: React.FC
= ({ programId }) => {
- return
+ return
}
export default ProgramContent