fix(11): make CI green — pin TZ in all-day scheduler tests, drop redundant casts
CI / changes (pull_request) Successful in 2s
CI / fast-checks (pull_request) Successful in 1m25s
CI / api (pull_request) Successful in 1m3s
CI / harness (pull_request) Successful in 4m14s
CI / security (pull_request) Successful in 41s
CI / gate (pull_request) Successful in 1s

fast-checks failed on 3 no-unnecessary-type-assertion ESLint errors (reminderIsCustom is now a real CalendarOccurrence field). api failed on 4 all-day 9 AM-local tests that assumed a UTC-4 host; CI runs UTC. Pin process.env.TZ=America/New_York in the all-day describe (production code reads TZ at call time, D-04).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Lucas Berger
2026-06-14 11:22:04 -04:00
co-authored by Claude Opus 4.8
parent 156bdf057b
commit eff9b13c66
2 changed files with 11 additions and 4 deletions
@@ -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). // 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. // 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. // 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(() => { beforeEach(() => {
prevTz = process.env.TZ;
process.env.TZ = 'America/New_York';
vi.useFakeTimers(); vi.useFakeTimers();
vi.resetModules(); vi.resetModules();
}); });
@@ -668,6 +673,8 @@ describe('reminderScheduler — NOTIF-06: all-day 9 AM-local fire branch', () =>
afterEach(() => { afterEach(() => {
vi.useRealTimers(); vi.useRealTimers();
vi.clearAllMocks(); 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 () => { 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, * This field is added by Plan 05 — before the fix, CalendarOccurrence does not carry it,
* so the form cannot distinguish custom from no-reminder. * 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', id: 'custom-alarm-uid::2026-12-15',
uid: 'custom-alarm-uid', uid: 'custom-alarm-uid',
calendarId: 1, calendarId: 1,
@@ -1280,7 +1280,7 @@ describe('EventForm — Phase 11 Plan 05 CR-01: custom alarm round-trip', () =>
renderForm({ renderForm({
mode: 'edit', mode: 'edit',
uid: 'custom-alarm-uid', uid: 'custom-alarm-uid',
eventOccurrence: CUSTOM_ALARM_OCCURRENCE as CalendarOccurrence, eventOccurrence: CUSTOM_ALARM_OCCURRENCE,
}); });
const reminderSelect = document.querySelector('#event-reminder') as HTMLSelectElement; 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({ renderForm({
mode: 'edit', mode: 'edit',
uid: 'custom-alarm-uid', uid: 'custom-alarm-uid',
eventOccurrence: CUSTOM_ALARM_OCCURRENCE as CalendarOccurrence, eventOccurrence: CUSTOM_ALARM_OCCURRENCE,
}); });
// The read-only "Custom (kept)" option must be visible // 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({ renderForm({
mode: 'edit', mode: 'edit',
uid: 'custom-alarm-uid', uid: 'custom-alarm-uid',
eventOccurrence: CUSTOM_ALARM_OCCURRENCE as CalendarOccurrence, eventOccurrence: CUSTOM_ALARM_OCCURRENCE,
}); });
// Change the title to simulate a real edit // Change the title to simulate a real edit