Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
bistaastha committed Dec 23, 2024
1 parent e636a7c commit 21383d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/fyle/dashboard/tasks/tasks-1.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
5 changes: 3 additions & 2 deletions src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/fyle/dashboard/tasks/tasks.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 21383d8

Please sign in to comment.