Files
vu/tests/calendar/octaves.test.ts
T
will eec76a1e4e
Deploy / deploy (push) Successful in 44s
calendar: enable the four remaining real octaves
Assumption (Aug 15-22), Nativity of the BVM (Sep 8-15), Immaculate
Conception (Dec 8-15), and All Saints (Nov 1-8) now declare octave:
{ enabled: true }, same generic mechanism as St. Lawrence and the
Christmas trio. Every octave this pull has identified is now modeled;
Matins reading content is a separate, larger follow-up (see conversation)
-- these still just commemorate at L/V-equivalent level for now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-11 08:20:47 -04:00

43 lines
1.9 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { activeOctavesFor, strictestThreshold } from '../../src/calendar/octaves';
describe('activeOctavesFor', () => {
it('finds nothing outside any octave window', () => {
expect(activeOctavesFor('2026-07-15')).toEqual([]);
});
it("finds a saint's own octave on its own day (day 1) and through day 8, not on day 9", () => {
const day1 = activeOctavesFor('2026-08-10'); // St. Lawrence's own day
expect(day1).toEqual([{ id: 'st-lawrence', name: 'St. Lawrence, Martyr', wins: 'semiduplex', dayNumber: 1 }]);
// Aug 17 is also day 3 of the Assumption's own octave (started Aug 15) --
// the two run concurrently this time of year.
const day8 = activeOctavesFor('2026-08-17');
expect(day8).toEqual([
{ id: 'st-lawrence', name: 'St. Lawrence, Martyr', wins: 'semiduplex', dayNumber: 8 },
{ id: 'assumption', name: 'The Assumption of the Blessed Virgin Mary', wins: 'semiduplex', dayNumber: 3 },
]);
// Aug 23: past both Lawrence's (ended Aug 17) and the Assumption's
// (ended Aug 22) windows.
expect(activeOctavesFor('2026-08-23')).toEqual([]);
});
it("Pentecost's octave uses its own configured threshold (duplex), not the default (semiduplex)", () => {
const octaves = activeOctavesFor('2026-05-29'); // within Pentecost's octave, 2026
expect(octaves).toEqual([{ id: 'pentecost-sunday', name: 'Pentecost', wins: 'duplex', dayNumber: 6 }]);
expect(strictestThreshold(octaves)).toBe('duplex');
});
it('stacks multiple active octaves oldest-started first', () => {
const octaves = activeOctavesFor('2033-12-29'); // St. Thomas of Canterbury's day
expect(octaves.map((o) => o.id)).toEqual([
'christmas-day',
'st-stephen-protomartyr',
'st-john-apostle',
'holy-innocents',
]);
expect(octaves.map((o) => o.dayNumber)).toEqual([5, 4, 3, 2]);
});
});