Files
vu/tests/calendar/june-sanctoral.test.ts
T
will 747a078580
Deploy / deploy (push) Successful in 49s
calendar: model Our Lady's Saturday as a real occurrence outcome
On a free Saturday (nothing privileged already claims it, no active
octave), the day's own identity is now "Our Lady's Saturday" rather
than an anonymous ordinary-feria -- mirrors privileged-feria-minor
exactly, per direct instruction: Semiduplex-or-higher still wins
outright (Marian Saturday doesn't apply at all); below that (Simplex,
and Vigil, both under semiduplex on the FeastClass scale) loses and is
commemorated instead. Layered additively after decideOccurrence, same
shape as applyOctaves -- never touches decideOccurrence's own rules.

Needed a real winner identity (not just the plain temporal feria id)
so day-label/antiphon/collect sourcing can recognize it -- added a
temporal-feasts record purely for that, and taught getDayLabel to
check it for any named temporal winner (a small, free improvement for
Christmas/Pentecost's own labels too, previously unhandled).

hours: build the duplex-majus+ Lauds psalmody override (per-feast)

lauds-psalmody no longer unconditionally uses the plain weekday
default: a duplex-majus-or-higher sanctoral winner, or Our Lady's
Saturday (unconditional, no rank threshold -- it isn't competing with
the weekday default the way a saint is), now substitutes its own
proper psalm groups/antiphons/canticle. Per-feast, not per-Common, per
direct instruction, even though most duplex-majus+ saints across the
year don't have one authored yet and fall back to the plain weekday
default until they do.

Content for the worked example (St. Lawrence's own day) surfaced a
real bug while sourcing it: st-lawrence-antiphon.yml had been read
from the Roman/secular rite's own [Ant 1], not Monastic 1617's actual
Benedictus antiphon for that day -- corrected from a fresh live query.

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

62 lines
2.6 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { resolveDay } from '../../src/calendar';
import { getDayCollect } from '../../src/hours/resolve-common';
// Clean per-annum years for these dates (no Sunday collision, and clear of
// the movable Corpus Christi Octave / generic Saturday-of-Mary votive that
// usually overshadow a couple of them) — see data/calendar/saints/*.yml
// for per-saint source detail.
describe('June sanctoral pull (first pass)', () => {
it('Ss. Peter and Paul win outright at Duplex I. classis with a real proper collect and antiphon', () => {
const day = resolveDay('2035-06-29');
expect(day.winner).toEqual({
kind: 'sanctoral',
id: 'ss-peter-and-paul',
name: 'Ss. Peter and Paul, Apostles',
rank: 'duplex-1-classis',
});
expect(getDayCollect(day).status.en).toBe('verified');
});
it('a saint normally blocked by the generic Saturday-of-Mary votive wins independently once the date falls on another weekday', () => {
const day = resolveDay('2026-06-02'); // a Tuesday
expect(day.winner).toEqual({
kind: 'sanctoral',
id: 'ss-marcellinus-peter-and-erasmus',
name: 'Ss. Marcellinus, Peter, and Erasmus, Bishop, Martyrs',
rank: 'simplex',
});
expect(getDayCollect(day).status.en).toBe('verified');
});
it('three distinct Pauline feasts this pull has found all resolve as separate records', () => {
const conversion = resolveDay('2026-01-25');
const peterAndPaul = resolveDay('2035-06-29');
const commemoration = resolveDay('2035-06-30');
const ids = [conversion, peterAndPaul, commemoration].map((d) =>
d.winner.kind === 'sanctoral' ? d.winner.id : null,
);
expect(ids).toEqual(['conversion-of-st-paul', 'ss-peter-and-paul', 'commemoration-of-st-paul']);
});
it('the Nativity of St. John the Baptist wins outright at Duplex I. classis, distinct from his Vigil the day before', () => {
// 2035-06-23 is a Saturday -- collides with the generic Saturday-of-
// Mary votive this test isn't about (see tests/calendar/marian-
// saturday.test.ts); 2027 keeps both dates on plain midweek days.
const vigil = resolveDay('2027-06-23');
const nativity = resolveDay('2027-06-24');
expect(vigil.winner).toEqual({
kind: 'sanctoral',
id: 'vigil-of-st-john-the-baptist',
name: 'Vigil of St. John the Baptist',
rank: 'vigil',
});
expect(nativity.winner).toEqual({
kind: 'sanctoral',
id: 'nativity-of-st-john-the-baptist',
name: 'The Nativity of St. John the Baptist',
rank: 'duplex-1-classis',
});
});
});