task-loop-rrule-projection.test.mjs
sha256:7fe782411f3a68b39f17777b274349b30752365c13438b26bfd602c687de2c65
feat(web): rebrand Parentier family to Ourware on landing
Human
minor
⚠ breaking
19 days ago
| 1 | /** |
| 2 | * Tier 1 — UNIT: RRULE next occurrence + occurrence_key projection. |
| 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 | const RECURRENCE = { |
| 9 | kind: 'rrule', |
| 10 | rrule: 'FREQ=WEEKLY;BYDAY=MO', |
| 11 | dtstart: '2026-06-02T16:00:00Z', |
| 12 | anchor_tz: 'America/Los_Angeles', |
| 13 | }; |
| 14 | |
| 15 | describe('Task loop RRULE — occurrence projection', () => { |
| 16 | it('projects next Monday occurrence after June 24 2026', () => { |
| 17 | const projection = projectNextOccurrence( |
| 18 | RECURRENCE, |
| 19 | { until_at: null }, |
| 20 | '2026-06-24T12:00:00Z', |
| 21 | ); |
| 22 | assert.ok(projection); |
| 23 | if (!projection) return; |
| 24 | assert.match(projection.occurrenceKey, /^2026-W\d{2}$/); |
| 25 | assert.ok(projection.occurrenceAt > '2026-06-24T12:00:00Z'); |
| 26 | }); |
| 27 | |
| 28 | it('returns null when series until_at is before after instant', () => { |
| 29 | const projection = projectNextOccurrence( |
| 30 | RECURRENCE, |
| 31 | { until_at: '2026-06-01T00:00:00Z' }, |
| 32 | '2026-06-24T12:00:00Z', |
| 33 | ); |
| 34 | assert.equal(projection, null); |
| 35 | }); |
| 36 | }); |
File History
1 commit
sha256:7fe782411f3a68b39f17777b274349b30752365c13438b26bfd602c687de2c65
feat(web): rebrand Parentier family to Ourware on landing
Human
minor
⚠
19 days ago