@@ -41,6 +41,14 @@ const mockEnrollments = {
4141 courseRunStatus : 'completed' ,
4242 } ,
4343 ] ,
44+ savedForLater : [
45+ {
46+ uuid : '5' ,
47+ courseKey : 'course-5' ,
48+ displayName : 'Course 5' ,
49+ courseRunStatus : 'saved_for_later' ,
50+ } ,
51+ ] ,
4452 assignmentsForDisplay : [
4553 {
4654 uuid : '4' ,
@@ -84,31 +92,38 @@ describe('CourseEnrollments', () => {
8492 it ( 'renders in-progress enrollments' , ( ) => {
8593 renderComponent ( { enrollments : mockEnrollments , isLoading : false } ) ;
8694 const enrollmentCards = screen . getAllByTestId ( 'enrollment-card' ) ;
87- expect ( enrollmentCards ) . toHaveLength ( 4 ) ;
95+ expect ( enrollmentCards ) . toHaveLength ( 5 ) ;
8896 expect ( screen . getByText ( 'Course 1' ) ) . toBeInTheDocument ( ) ;
8997 } ) ;
9098
9199 it ( 'renders upcoming enrollments' , ( ) => {
92100 renderComponent ( { enrollments : mockEnrollments , isLoading : false } ) ;
93101 const enrollmentCards = screen . getAllByTestId ( 'enrollment-card' ) ;
94- expect ( enrollmentCards ) . toHaveLength ( 4 ) ;
102+ expect ( enrollmentCards ) . toHaveLength ( 5 ) ;
95103 expect ( screen . getByText ( 'Course 2' ) ) . toBeInTheDocument ( ) ;
96104 } ) ;
97105
98106 it ( 'renders completed enrollments' , ( ) => {
99107 renderComponent ( { enrollments : mockEnrollments , isLoading : false } ) ;
100108 const enrollmentCards = screen . getAllByTestId ( 'enrollment-card' ) ;
101- expect ( enrollmentCards ) . toHaveLength ( 4 ) ;
109+ expect ( enrollmentCards ) . toHaveLength ( 5 ) ;
102110 expect ( screen . getByText ( 'Course 3' ) ) . toBeInTheDocument ( ) ;
103111 } ) ;
104112
105113 it ( 'renders assigned enrollments' , ( ) => {
106114 renderComponent ( { enrollments : mockEnrollments , isLoading : false } ) ;
107115 const enrollmentCards = screen . getAllByTestId ( 'enrollment-card' ) ;
108- expect ( enrollmentCards ) . toHaveLength ( 4 ) ;
116+ expect ( enrollmentCards ) . toHaveLength ( 5 ) ;
109117 expect ( screen . getByText ( 'Course 4' ) ) . toBeInTheDocument ( ) ;
110118 } ) ;
111119
120+ it ( 'renders saved for later enrollments' , ( ) => {
121+ renderComponent ( { enrollments : mockEnrollments , isLoading : false } ) ;
122+ const enrollmentCards = screen . getAllByTestId ( 'enrollment-card' ) ;
123+ expect ( enrollmentCards ) . toHaveLength ( 5 ) ;
124+ expect ( screen . getByText ( 'Course 5' ) ) . toBeInTheDocument ( ) ;
125+ } ) ;
126+
112127 it ( 'renders enrollments header' , ( ) => {
113128 renderComponent ( { enrollments : mockEnrollments , isLoading : false } ) ;
114129 expect ( screen . getByText ( 'Enrollments' ) ) . toBeInTheDocument ( ) ;
0 commit comments