Skip to content

Commit

Permalink
feat: Track suggested duplicates usage in edit expense page (#2655)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmkarJ13 committed Dec 18, 2023
1 parent fa69ec9 commit 53d2c0b
Show file tree
Hide file tree
Showing 4 changed files with 9 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 @@ -626,4 +626,8 @@ export class TrackingService {
enrollingNonRTFCard(properties: EnrollingNonRTFCardProperties): void {
this.eventTrack('Enrolling Non RTF Card', properties);
}

showSuggestedDuplicates(): void {
this.eventTrack('Show Suggested Duplicates');
}
}
2 changes: 2 additions & 0 deletions src/app/fyle/add-edit-expense/add-edit-expense-2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ export function TestCases2(getTestBed) {
component.showSuggestedDuplicates([expenseData1]);
tick(500);

expect(trackingService.showSuggestedDuplicates).toHaveBeenCalledTimes(1);
expect(modalController.create).toHaveBeenCalledOnceWith({
component: SuggestedDuplicatesComponent,
componentProps: {
Expand All @@ -1493,6 +1494,7 @@ export function TestCases2(getTestBed) {
component.showSuggestedDuplicates([expenseData1]);
tick(500);

expect(trackingService.showSuggestedDuplicates).toHaveBeenCalledTimes(1);
expect(modalController.create).toHaveBeenCalledOnceWith({
component: SuggestedDuplicatesComponent,
componentProps: {
Expand Down
2 changes: 2 additions & 0 deletions src/app/fyle/add-edit-expense/add-edit-expense.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4905,6 +4905,8 @@ export class AddEditExpensePage implements OnInit {
}

async showSuggestedDuplicates(duplicateExpenses: Expense[]): Promise<void> {
this.trackingService.showSuggestedDuplicates();

const txnIDs = duplicateExpenses.map((expense) => expense.tx_id);
const currencyModal = await this.modalController.create({
component: SuggestedDuplicatesComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ describe('AddEditExpensePage', () => {
'hideMoreClicked',
'showMoreClicked',
'newExpenseCreatedFromPersonalCard',
'showSuggestedDuplicates',
]);
const recentLocalStorageItemsServiceSpy = jasmine.createSpyObj('RecentLocalStorageItemsService', ['get']);
const recentlyUsedItemsServiceSpy = jasmine.createSpyObj('RecentlyUsedItemsService', [
Expand Down

0 comments on commit 53d2c0b

Please sign in to comment.