Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/app/resources/resource.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions src/app/resources/resources.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down