task-loop-rrule-tz.test.mjs
25 lines 964 B
Raw
sha256:b5f647cb9c409f563d4671fe3fc05ddea01fabfed9b41fc11cb923588e1c1baf mirror: GitHub Phase A durable MCP OAuth (#270) Human minor ⚠ breaking 10 days ago
1 /**
2 * Tier 5 — DATA-INTEGRITY: DST boundary occurrence keys remain stable strings.
3 */
4 import { describe, it } from 'node:test';
5 import assert from 'node:assert/strict';
6 import { projectNextOccurrence } from '../lib/task/task-loop-rrule.mjs';
7
8 describe('Task loop RRULE — timezone occurrence keys', () => {
9 it('weekly occurrence key format is stable across projection calls', () => {
10 const recurrence = {
11 kind: 'rrule',
12 rrule: 'FREQ=WEEKLY;BYDAY=MO',
13 dtstart: '2026-03-02T17:00:00Z',
14 anchor_tz: 'America/Los_Angeles',
15 };
16
17 const first = projectNextOccurrence(recurrence, { until_at: null }, '2026-03-01T00:00:00Z');
18 const second = projectNextOccurrence(recurrence, { until_at: null }, '2026-03-01T00:00:00Z');
19 assert.ok(first);
20 assert.ok(second);
21 if (!first || !second) return;
22 assert.equal(first.occurrenceKey, second.occurrenceKey);
23 assert.match(first.occurrenceKey, /^\d{4}-W\d{2}$/);
24 });
25 });
File History 1 commit
sha256:b5f647cb9c409f563d4671fe3fc05ddea01fabfed9b41fc11cb923588e1c1baf mirror: GitHub Phase A durable MCP OAuth (#270) Human minor 10 days ago