Skip to content

Commit 11ed645

Browse files
committed
fix: fix closing of notifications settings modal (#4072)
1 parent 6778282 commit 11ed645

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/app/fyle/notifications/email-notifications/email-notifications.component.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ describe('EmailNotificationsComponent', () => {
173173
});
174174

175175
describe('closeModal():', () => {
176+
it('should dismiss the modal directly when there are no unsaved changes', async () => {
177+
component.hasChanges = false;
178+
179+
await component.closeModal();
180+
181+
expect(modalController.dismiss).toHaveBeenCalledWith({
182+
employeeSettingsUpdated: false,
183+
});
184+
});
185+
176186
it('should not dismiss the modal directly when there are unsaved changes', async () => {
177187
component.hasChanges = true;
178188

src/app/fyle/notifications/email-notifications/email-notifications.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ export class EmailNotificationsComponent implements OnInit {
145145
this.hasChanges = false;
146146
this.modalController.dismiss({ employeeSettingsUpdated: false });
147147
}
148+
} else {
149+
this.modalController.dismiss({ employeeSettingsUpdated: false });
148150
}
149151
}
150152

@@ -263,7 +265,7 @@ export class EmailNotificationsComponent implements OnInit {
263265

264266
ngOnInit(): void {
265267
this.isIos = this.platform.is('ios');
266-
this.isLongTitle = this.title.length > 25;
268+
this.isLongTitle = this.title.length > 20;
267269
this.updateSelectAll();
268270

269271
const isPushColumnSupportedForTitle =

0 commit comments

Comments
 (0)