Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

‼️📅 Rewrite - notifScheduler.ts #1092

Merged
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4abe86d
Add notifScheduler.ts
sebastianbarry Oct 31, 2023
da87f47
Merge branch 'service_rewrite_2023' into notifScheduler-rewrite
sebastianbarry Nov 2, 2023
1bfb113
Merge branch 'service_rewrite_2023' into notifScheduler-rewrite
sebastianbarry Nov 2, 2023
131eca5
Format notifScheduler.ts
sebastianbarry Nov 2, 2023
cc7664f
Merge branch 'service_rewrite_2023' into notifScheduler-rewrite
sebastianbarry Nov 2, 2023
39986a3
Temporary any type, handled purely in notifScheduler getReminderPrefs
sebastianbarry Nov 2, 2023
58539ca
Undoing imports getting duplicated during prettier changes
sebastianbarry Nov 2, 2023
384ffe8
Replace console.log with logger.ts's displayErrorMsg
sebastianbarry Nov 2, 2023
9d3c718
Move scheduledNotifs into the only function that uses it
sebastianbarry Nov 3, 2023
a1e035f
Remove console.errors that I was using for debugging
sebastianbarry Nov 3, 2023
8b09cb3
Adding Luxon functions
sebastianbarry Nov 3, 2023
96d1d50
Update notifscheduler to export functions instead of using hooks
sebastianbarry Nov 3, 2023
a6d99e7
Run prettier on non-pretty code
sebastianbarry Nov 3, 2023
b0da6e9
Remove old Angular notifScheduler.js
sebastianbarry Nov 7, 2023
6b9d222
Add the reminderSchemes as an argument to called getReminderPrefs
sebastianbarry Nov 7, 2023
97571ee
Added typing for User object in getReminderPrefs
sebastianbarry Nov 7, 2023
a29705d
Restructure promise format and replaced moment with Luxon
sebastianbarry Nov 7, 2023
9b4b1d0
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Nov 9, 2023
ba239e6
Resolve the app crashing errors
sebastianbarry Nov 9, 2023
2f75de9
Remove unnecessary imports
sebastianbarry Nov 10, 2023
5e572d4
notif-scheduling-state variables kept in ProfileSettings.jsx and hand…
sebastianbarry Nov 14, 2023
db91c8c
Remove empty objects from notifs, fixing the "n.trigger.at does not e…
sebastianbarry Nov 14, 2023
e4817da
Added removeEmptyObjects check to the other cordova plugin getSchedul…
sebastianbarry Nov 14, 2023
0ee468a
Added sorting to list of notifications right before they get scheduled
sebastianbarry Nov 16, 2023
e209f10
Change static variable isScheduling to a useState
sebastianbarry Nov 16, 2023
b8bf1cf
Replace console.logs with logDebugs
sebastianbarry Nov 16, 2023
b27ae9a
Add in more type declarations
sebastianbarry Nov 16, 2023
abbe618
Add Jest Testing - getScheduledNotifs
sebastianbarry Nov 16, 2023
fbd1b62
Add first updateScheduledNotifs test
sebastianbarry Nov 17, 2023
87fdae5
Add reminder scheme missing test for updateScheduledNotifs
sebastianbarry Nov 21, 2023
214081e
Add already scheduled notifs test
sebastianbarry Nov 22, 2023
f5ebb1e
Fixing comments
sebastianbarry Nov 22, 2023
6892580
Final overall test for updateScheduledNotifs
sebastianbarry Nov 24, 2023
e8b449f
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Nov 30, 2023
85f0519
Added user exists test for getReminderPrefs
sebastianbarry Nov 30, 2023
0528fb0
Remove unnecessary console.log
sebastianbarry Nov 30, 2023
2c0ec40
Fixing moved location of commHelper causing jest tests to fail
sebastianbarry Nov 30, 2023
35ffc41
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Dec 6, 2023
4e44dba
fix error on configs without reminderSchemes
JGreenlee Dec 6, 2023
5ee4d64
Add getReminderPrefs test for when user does not exist
sebastianbarry Dec 12, 2023
d3750c3
Add simple setReminderPrefs test
sebastianbarry Dec 12, 2023
ec9729d
Add test for updateScheduledNotifs to test if notifs successfully get…
sebastianbarry Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are keeping the logDebug tests, we should change this from console.log to logDebug so we can test the alerting behavior.

};
console.error = (msg) => {
console.log(msg);
};
};

let alerts = [];
Expand Down
Loading
Loading