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
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:
co-authored by
Claude Opus 4.8
parent
156bdf057b
commit
eff9b13c66
@@ -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 () => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user