Skip to content

Commit

Permalink
feat: added robust tracker for task (#3136)
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashpatil78 authored Jul 7, 2024
1 parent dbe7c8f commit 294021b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/core/services/tracking.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ export class TrackingService {
this.eventTrack('Opted In From Profile');
}

optedInFromTasks(): void {
this.eventTrack('Opted In From Tasks');
}

clickedOnDashboardBanner(): void {
this.eventTrack('Clicked On Dashboard Banner');
}
Expand Down
1 change: 1 addition & 0 deletions src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export function TestCases2(getTestBed) {
expect(optInModalSpy.present).toHaveBeenCalledTimes(1);
expect(optInModalSpy.onWillDismiss).toHaveBeenCalledTimes(1);
expect(component.doRefresh).toHaveBeenCalledTimes(1);
expect(trackingService.optedInFromTasks).toHaveBeenCalledTimes(1);
}));

describe('onReviewExpensesTaskClick():', () => {
Expand Down
1 change: 1 addition & 0 deletions src/app/fyle/dashboard/tasks/tasks.component.setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe('TasksComponent', () => {
'commuteDeductionTaskClicked',
'commuteDeductionDetailsAddedFromSpenderTask',
'clickedOnTask',
'optedInFromTasks',
]);
const loaderServiceSpy = jasmine.createSpyObj('LoaderService', ['showLoader', 'hideLoader']);
const matBottomSheetSpy = jasmine.createSpyObj('MatBottomSheet', ['open']);
Expand Down
1 change: 1 addition & 0 deletions src/app/fyle/dashboard/tasks/tasks.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ export class TasksComponent implements OnInit {
const { data } = await optInModal.onWillDismiss<{ action: string }>();

if (data && data.action === 'SUCCESS') {
this.trackingService.optedInFromTasks();
this.doRefresh();
this.optedIn.emit();
}
Expand Down

0 comments on commit 294021b

Please sign in to comment.