Phase 11: Per-Event Reminders (CAL-13/14, NOTIF-04/05/06) #19

Merged
luckberg merged 41 commits from gsd/phase-11-per-event-reminders into main 2026-06-14 14:06:45 -04:00
2 changed files with 11 additions and 4 deletions
Showing only changes of commit eff9b13c66 - Show all commits
@@ -659,8 +659,13 @@ describe('reminderScheduler — NOTIF-06: all-day 9 AM-local fire branch', () =>
// All-day tests use the server timezone (America/New_York = UTC-4 in summer).
// computeAlertInstantUtc('2026-06-15', 0, 'America/New_York') = 2026-06-15T13:00:00Z.
// Tests set `now` to the expected alert UTC to trigger the fire window.
// Pin TZ explicitly so these assertions are deterministic regardless of the host/CI
// timezone (CI runs UTC; the scheduler reads process.env.TZ at call time, D-04).
let prevTz: string | undefined;
beforeEach(() => {
prevTz = process.env.TZ;
process.env.TZ = 'America/New_York';
vi.useFakeTimers();
vi.resetModules();
});
@@ -668,6 +673,8 @@ describe('reminderScheduler — NOTIF-06: all-day 9 AM-local fire branch', () =>
afterEach(() => {
vi.useRealTimers();
vi.clearAllMocks();
if (prevTz === undefined) delete process.env.TZ;
else process.env.TZ = prevTz;
});
it('all-day 0-lead fires at 9 AM local (not midnight) on event date', async () => {
+4 -4
View File
@@ -1246,7 +1246,7 @@ describe('EventForm — Phase 11 reminder picker (Plan 04)', () => {
* This field is added by Plan 05 — before the fix, CalendarOccurrence does not carry it,
* so the form cannot distinguish custom from no-reminder.
*/
const CUSTOM_ALARM_OCCURRENCE: CalendarOccurrence & { reminderIsCustom?: boolean } = {
const CUSTOM_ALARM_OCCURRENCE: CalendarOccurrence = {
id: 'custom-alarm-uid::2026-12-15',
uid: 'custom-alarm-uid',
calendarId: 1,
@@ -1280,7 +1280,7 @@ describe('EventForm — Phase 11 Plan 05 CR-01: custom alarm round-trip', () =>
renderForm({
mode: 'edit',
uid: 'custom-alarm-uid',
eventOccurrence: CUSTOM_ALARM_OCCURRENCE as CalendarOccurrence,
eventOccurrence: CUSTOM_ALARM_OCCURRENCE,
});
const reminderSelect = document.querySelector('#event-reminder') as HTMLSelectElement;
@@ -1293,7 +1293,7 @@ describe('EventForm — Phase 11 Plan 05 CR-01: custom alarm round-trip', () =>
renderForm({
mode: 'edit',
uid: 'custom-alarm-uid',
eventOccurrence: CUSTOM_ALARM_OCCURRENCE as CalendarOccurrence,
eventOccurrence: CUSTOM_ALARM_OCCURRENCE,
});
// The read-only "Custom (kept)" option must be visible
@@ -1307,7 +1307,7 @@ describe('EventForm — Phase 11 Plan 05 CR-01: custom alarm round-trip', () =>
renderForm({
mode: 'edit',
uid: 'custom-alarm-uid',
eventOccurrence: CUSTOM_ALARM_OCCURRENCE as CalendarOccurrence,
eventOccurrence: CUSTOM_ALARM_OCCURRENCE,
});
// Change the title to simulate a real edit