From 0d3925130f027e4db8fbeeea387e95d6448c0c66 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 21 Aug 2026 23:54:39 -0700 Subject: [PATCH] test(automations): pin the day-restriction divergence a stepped bare start exposes Refs #15896 --- src/shared/automation-schedules.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shared/automation-schedules.test.ts b/src/shared/automation-schedules.test.ts index 7c8421192f7..69e8ff8a09e 100644 --- a/src/shared/automation-schedules.test.ts +++ b/src/shared/automation-schedules.test.ts @@ -241,6 +241,15 @@ describe('automation schedules', () => { expect(nextAutomationOccurrenceAfter('0 9 1 * 0/1', CRON_ANCHOR, afterFirst)).not.toBe( nextAutomationOccurrenceAfter('0 9 1 * 0', CRON_ANCHOR, afterFirst) ) + // Known divergence (#15896): vixie restricts off a literal `*`, so it ORs `1/1` with Mondays + // and fires Wed Jul 1 as well. Pinned so the follow-up has to flip it on purpose. + const beforeJulyFirst = new Date('2026-06-30T10:00:00').getTime() + expect(nextAutomationOccurrenceAfter('0 0 1/1 * 1', CRON_ANCHOR, beforeJulyFirst)).toBe( + nextAutomationOccurrenceAfter('0 0 * * 1', CRON_ANCHOR, beforeJulyFirst) + ) + expect(nextAutomationOccurrenceAfter('0 0 1/1 * 1', CRON_ANCHOR, beforeJulyFirst)).not.toBe( + nextAutomationOccurrenceAfter('0 0 1 * 1', CRON_ANCHOR, beforeJulyFirst) + ) }) it('keeps wildcard and range steps intact and applies steps per list element', () => {