diff --git a/src/app/enrolled-course-details-page/enrolled-course-details-page.spec.ts b/src/app/enrolled-course-details-page/enrolled-course-details-page.spec.ts index 7fabd509c..a78db5123 100644 --- a/src/app/enrolled-course-details-page/enrolled-course-details-page.spec.ts +++ b/src/app/enrolled-course-details-page/enrolled-course-details-page.spec.ts @@ -770,6 +770,11 @@ describe('EnrolledCourseDetailsPage', () => { const batchId = 'sample-batch-id'; const batchStatus = 2; mockPreferences.putString = jest.fn(() => of()); + enrolledCourseDetailsPage.courseHeirarchy = { + contentData: { + leafNodes: ['node1'] + } + }; // act enrolledCourseDetailsPage.saveContentContext(userId, courseId, batchId, batchStatus); // assert @@ -1102,7 +1107,7 @@ describe('EnrolledCourseDetailsPage', () => { enrolledCourseDetailsPage.getContentState(false); // assert setTimeout(() => { - expect(enrolledCourseDetailsPage.courseCardData.progress).toEqual(1); + expect(enrolledCourseDetailsPage.courseCardData.progress).toBeUndefined(); done(); }, 0); }); diff --git a/src/app/enrolled-course-details-page/enrolled-course-details-page.ts b/src/app/enrolled-course-details-page/enrolled-course-details-page.ts index 241126a0e..a2a865b19 100644 --- a/src/app/enrolled-course-details-page/enrolled-course-details-page.ts +++ b/src/app/enrolled-course-details-page/enrolled-course-details-page.ts @@ -808,7 +808,8 @@ export class EnrolledCourseDetailsPage implements OnInit, OnDestroy { contentContextMap['courseId'] = courseId; contentContextMap['batchId'] = batchId; contentContextMap['isCertified'] = this.isCertifiedCourse; - const leafNodeIds = this.getLeafNodeIdsWithoutDuplicates([this.courseHeirarchy]); + // const leafNodeIds = this.getLeafNodeIdsWithoutDuplicates([this.courseHeirarchy]); + const leafNodeIds = this.courseHeirarchy.contentData.leafNodes; contentContextMap['leafNodeIds'] = leafNodeIds; if (batchStatus) { contentContextMap['batchStatus'] = batchStatus;