task-loop-rrule-tz.test.mjs
25 lines 964 B
Raw
sha256:baa800aedf841dbf32081aa7b2befa288ac33dfc7175ac55014c55c4d8c742f9 docs: move durable-auth freeze/evidence to local developmen… Human 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:baa800aedf841dbf32081aa7b2befa288ac33dfc7175ac55014c55c4d8c742f9 docs: move durable-auth freeze/evidence to local developmen… Human 10 days ago