Commit 79ea847
fix: add clockProvider to CalendarProvider for test time injection (#228)
CalendarProviderReminderTest was failing because:
- CalendarProvider.getNextEventReminderTime() filters reminders using clock.currentTimeMillis()
- With test time changed to December 2023 (past) and real time being January 2026
- All reminders were filtered out as 'in the past', returning 0
Added clockProvider pattern to CalendarProvider (same as ApplicationController)
and inject test clock via CalendarProviderTestFixture.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>1 parent bb3acab commit 79ea847
2 files changed
Lines changed: 21 additions & 2 deletions
File tree
- android/app/src
- androidTest/java/com/github/quarck/calnotify/testutils
- main/java/com/github/quarck/calnotify/calendar
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
| |||
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
| |||
0 commit comments