0404642614
Deploy / deploy (push) Successful in 51s
A 1925 addition, so nowhere in the Monastic Tridentinum 1617 base this project otherwise targets -- content sourced from "Monastic Divino 1930" instead, the Monastic-lineage version of the era that actually carries it. Always wins outright (Duplex I. classis, confirmed live), commemorating whichever Sunday after Pentecost it displaces -- same additive-layering shape as applyOctaves/applyMarianSaturday, run last so nested commemorations (e.g. a Simplex saint already commemorated under that Sunday) survive underneath it. Extended the Lauds psalmody-override mechanism (both the psalm groups and, newly, the chapter/responsory/hymn/versicle bundle) to recognize named temporal winners as unconditionally override-eligible, not just duplex-majus+ sanctoral ones -- generalizing what had been a Marian- Saturday-only special case. Suffrages needed their own explicit check too: isDoubleOrHigher only ever looks at a sanctoral rank, and a named temporal winner has no FeastClass to check at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
40 lines
1.9 KiB
TypeScript
40 lines
1.9 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { resolveDay } from '../../src/calendar';
|
|
import { getDayLabel } from '../../src/calendar/day-label';
|
|
|
|
// A 1925 addition, not in the Monastic Tridentinum 1617 base this project
|
|
// otherwise targets -- content sourced from "Monastic Divino 1930"
|
|
// instead. Always wins the last Sunday of October, commemorating
|
|
// whichever Sunday after Pentecost it displaces.
|
|
describe('Christ the King (applyChristTheKing)', () => {
|
|
it('wins outright on the last Sunday of October, commemorating the Sunday it displaces', () => {
|
|
const day = resolveDay('2026-10-25'); // last Sunday of October 2026
|
|
expect(day.winner).toEqual({ kind: 'temporal', id: 'christ-the-king' });
|
|
expect(day.commemorations).toContainEqual({ kind: 'temporal', id: 'post-pentecost-22' });
|
|
expect(getDayLabel(day)).toBe('Christ the King');
|
|
});
|
|
|
|
it('preserves a nested commemoration: a Simplex saint already commemorated under the ordinary Sunday stays commemorated', () => {
|
|
// Ss. Chrysanthus and Daria, Simplex, land on 2026-10-25 -- already
|
|
// commemorated under the Sunday per the ordinary-sunday rule before
|
|
// Christ the King further displaces that Sunday itself.
|
|
const day = resolveDay('2026-10-25');
|
|
expect(day.commemorations).toContainEqual({
|
|
kind: 'sanctoral',
|
|
id: 'ss-chrysanthus-and-daria',
|
|
name: 'Ss. Chrysanthus and Daria, Martyrs',
|
|
rank: 'simplex',
|
|
});
|
|
});
|
|
|
|
it('does not apply on any other Sunday in October', () => {
|
|
const day = resolveDay('2026-10-18');
|
|
expect(day.winner).not.toEqual({ kind: 'temporal', id: 'christ-the-king' });
|
|
});
|
|
|
|
it('correctly finds a different last Sunday of October in a year where Oct 31 itself is a Sunday', () => {
|
|
const day = resolveDay('2027-10-31'); // 2027-10-31 is a Sunday
|
|
expect(day.winner).toEqual({ kind: 'temporal', id: 'christ-the-king' });
|
|
});
|
|
});
|