Skip to content

Commit

Permalink
Merge pull request #1092 from sebastianbarry/notifScheduler-rewrite
Browse files Browse the repository at this point in the history
‼️📅 Rewrite - notifScheduler.ts
  • Loading branch information
shankari authored Jan 20, 2024
2 parents c91e8c0 + ec9729d commit 14c748d
Show file tree
Hide file tree
Showing 9 changed files with 862 additions and 295 deletions.
10 changes: 10 additions & 0 deletions www/__mocks__/cordovaMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ export const mockCordova = () => {
window['cordova'].plugins ||= {};
};

export const mockReminders = () => {
window['cordova'] ||= {};
window['cordova'].plugins ||= {};
window['cordova'].plugins.notification ||= {};
window['cordova'].plugins.notification.local ||= {};
window['cordova'].plugins.notification.local.getScheduled ||= () => [];
window['cordova'].plugins.notification.local.cancelAll ||= () => {};
window['cordova'].plugins.notification.local.schedule ||= () => {};
};

export const mockDevice = () => {
window['device'] ||= {};
window['device'].platform ||= 'ios';
Expand Down
6 changes: 6 additions & 0 deletions www/__mocks__/globalMocks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export const mockLogger = () => {
window['Logger'] = { log: console.log };
window.alert = (msg) => {
console.log(msg);
};
console.error = (msg) => {
console.log(msg);
};
};

let alerts = [];
Expand Down
Loading

0 comments on commit 14c748d

Please sign in to comment.