diff --git a/src/app/resources/resource.component.spec.ts b/src/app/resources/resource.component.spec.ts index 2f11c18a9b..8caf10a947 100644 --- a/src/app/resources/resource.component.spec.ts +++ b/src/app/resources/resource.component.spec.ts @@ -1348,12 +1348,13 @@ describe('ResourcesComponent', () => { it('should generate an interact telemetry when clicked on class', () => { // arrange mockTelemetryGeneratorService.generateInteractTelemetry = jest.fn(); + resourcesComponent.category3Code = 'sampleCategory3' // act resourcesComponent.generateClassInteractTelemetry('class 6', 'class 5'); // assert expect(mockTelemetryGeneratorService.generateInteractTelemetry).toHaveBeenCalledWith( InteractType.TOUCH, - InteractSubtype.CLASS_CLICKED, + InteractSubtype.CATEGORY_CLICKED.replace('%', resourcesComponent.category3Code), Environment.HOME, PageId.LIBRARY, undefined, @@ -1364,12 +1365,13 @@ describe('ResourcesComponent', () => { it('should generate an interact telemetry when clicked on class', () => { // arrange mockTelemetryGeneratorService.generateInteractTelemetry = jest.fn(); + resourcesComponent.category2Code = 'sampleCategory2' // act resourcesComponent.generateMediumInteractTelemetry('hindi', 'english'); // assert expect(mockTelemetryGeneratorService.generateInteractTelemetry).toHaveBeenCalledWith( InteractType.TOUCH, - InteractSubtype.MEDIUM_CLICKED, + InteractSubtype.CATEGORY_CLICKED.replace('%', resourcesComponent.category2Code), Environment.HOME, PageId.LIBRARY, undefined, @@ -1812,7 +1814,7 @@ describe('ResourcesComponent', () => { corRelationList.push({ id: (event.data.contents.length).toString(), type: CorReleationDataType.COURSE_COUNT }); const appliedFilter = { board: undefined, - medium: ["hindi"], + medium: ["english"], gradeLevel: [""], } const curriculumCourseParams = { diff --git a/src/app/resources/resources.component.ts b/src/app/resources/resources.component.ts index 0eb1b99379..e408ba1769 100644 --- a/src/app/resources/resources.component.ts +++ b/src/app/resources/resources.component.ts @@ -774,7 +774,7 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy, Fra values['currentSelected'] = currentClass; values['previousSelected'] = previousClass; this.telemetryGeneratorService.generateInteractTelemetry(InteractType.TOUCH, - InteractSubtype.CLASS_CLICKED, + InteractSubtype.CATEGORY_CLICKED.replace('%', this.category3Code), Environment.HOME, PageId.LIBRARY, undefined, @@ -786,7 +786,7 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy, Fra values['currentSelected'] = currentMedium; values['previousSelected'] = previousMedium; this.telemetryGeneratorService.generateInteractTelemetry(InteractType.TOUCH, - InteractSubtype.MEDIUM_CLICKED, + InteractSubtype.CATEGORY_CLICKED.replace('%', this.category2Code), Environment.HOME, PageId.LIBRARY, undefined,