diff --git a/src/app/fyle/dashboard/tasks/tasks-1.component.spec.ts b/src/app/fyle/dashboard/tasks/tasks-1.component.spec.ts index cc272da464..65815acde6 100644 --- a/src/app/fyle/dashboard/tasks/tasks-1.component.spec.ts +++ b/src/app/fyle/dashboard/tasks/tasks-1.component.spec.ts @@ -494,7 +494,7 @@ export function TestCases1(getTestBed) { expect(component.onPotentialDuplicatesTaskClick).not.toHaveBeenCalled(); expect(component.onSentBackAdvanceTaskClick).not.toHaveBeenCalled(); expect(component.onMobileNumberVerificationTaskClick).not.toHaveBeenCalled(); - expect(component.onCommuteDetailsTaskClick).not.toHaveBeenCalledTimes(1); + expect(component.onCommuteDetailsTaskClick).not.toHaveBeenCalled(); expect(component.onAddCorporateCardClick).toHaveBeenCalledTimes(1); }); diff --git a/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts b/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts index 0c4d7f8a5f..b674f20a01 100644 --- a/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts +++ b/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts @@ -205,13 +205,14 @@ export function TestCases2(getTestBed) { }); }); - it('onAddCorporateCardClick(): should open card popover', () => { + fit('onAddCorporateCardClick(): should open card popover', () => { orgSettingsService.get.and.returnValue(of(orgSettingsPendingRestrictions)); orgUserSettingsService.get.and.returnValue(of(orgUserSettingsData)); const addCardPopoverSpy = jasmine.createSpyObj('HTMLIonPopoverElement', ['present', 'onDidDismiss']); addCardPopoverSpy.present.and.resolveTo(); - addCardPopoverSpy.onDidDismiss.and.resolveTo({}); + addCardPopoverSpy.onDidDismiss.and.resolveTo({ success: true }); popoverController.create.and.resolveTo(addCardPopoverSpy); + spyOn(component, 'handleEnrollmentSuccess'); fixture.detectChanges(); component.onAddCorporateCardClick(); diff --git a/src/app/fyle/dashboard/tasks/tasks.component.ts b/src/app/fyle/dashboard/tasks/tasks.component.ts index d059b9d261..489cefb8a5 100644 --- a/src/app/fyle/dashboard/tasks/tasks.component.ts +++ b/src/app/fyle/dashboard/tasks/tasks.component.ts @@ -498,9 +498,9 @@ export class TasksComponent implements OnInit { }); await addCorporateCardPopover.present(); - const popoverResponse = (await addCorporateCardPopover.onDidDismiss()) as OverlayResponse<{ success: boolean }>; + const popoverResponse = (await addCorporateCardPopover.onDidDismiss()) as { success: boolean }; - if (popoverResponse.data?.success) { + if (popoverResponse.success) { this.handleEnrollmentSuccess(); } }