write a unit test for local notification in angular
Budget: $10 – $30 CAD
I need three unit test that mock the notification when that is granted, denied and prompt.
I will send you the project after you sent a message.
Method to be written unit test)
public async onNotificationToggleClick() {
const currentNotificationStatus = this.notificationToggle.checked;
const { display } = await LocalNotifications.checkPermissions();
if (display !== 'prompt') {
await this.modalHandlerService.displayModalHandler('a', 'b', 'c');
this.modalHandlerService.dismissHandler().then((data) => {
});
this.notificationToggle.checked = currentNotificationStatus;
return;
}
const { display: requestPermissions } =
await LocalNotifications.requestPermissions();
this.notificationToggle.checked = requestPermissions === 'granted';
}
I will send you the project after you sent a message.
Method to be written unit test)
public async onNotificationToggleClick() {
const currentNotificationStatus = this.notificationToggle.checked;
const { display } = await LocalNotifications.checkPermissions();
if (display !== 'prompt') {
await this.modalHandlerService.displayModalHandler('a', 'b', 'c');
this.modalHandlerService.dismissHandler().then((data) => {
});
this.notificationToggle.checked = currentNotificationStatus;
return;
}
const { display: requestPermissions } =
await LocalNotifications.requestPermissions();
this.notificationToggle.checked = requestPermissions === 'granted';
}