Files
vu/tests/propers/octave-readings.test.ts
T
will e35183bfac
Deploy / deploy (push) Successful in 46s
propers: add octave Matins readings, starting with St. Lawrence's
Adds propers/octave-readings.ts: a day-indexed lookup
(getOctaveReading(octaveId, dayNumber), id convention
"${octaveId}-octave-day-${dayNumber}") since readings genuinely vary day
to day within a single octave (confirmed: the Assumption's own octave
gives different patristic excerpts on day 2 vs. day 5) -- the singular
OctaveConfig.readingId field from the previous commit didn't fit that
reality and is removed.

Sourced via a different query command (prayMatutinum, not prayTertia)
than every other proper this pull has pulled -- the raw per-date
Sancti/MM-DD.txt files for octave-continuation days are occupied by
unrelated later-calendar saints (same trap as everywhere else), but the
real content lives in MM-DDoct.txt/MM-DDbmv.txt-style variant files the
live engine resolves correctly.

Per project convention (2026-08 discussion): the historical 3 (or 9-12,
on a day's own higher-rank office) Lectios are collapsed into one
continuous reading rather than kept broken up, and only the first
responsory is kept (which one to use when several collapse into one is
still an open question). A caught bug along the way: several readings
have no English translation in the source at all -- its own English page
silently falls back to showing the Latin text under the "Reading"
header, which an early pass mistakenly stored as a duplicate before the
mismatch was caught; now left honestly missing instead.

St. Lawrence's octave: real readings for days 2-5 and 8 (day 8, "In
Octava S. Laurentii," is a fuller distinct office); days 6-7 (Aug 15-16)
belong entirely to the Assumption's feast and octave instead -- day 7's
query, redirected, became assumption-octave-day-2's reading. The other
five octaves (Assumption's remaining days, Nativity BVM, Immaculate
Conception, All Saints, the Christmas trio, Pentecost) are follow-up
work, not done in this pass.

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

32 lines
1.5 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { getOctaveReading } from '../../src/propers';
describe('getOctaveReading', () => {
it('resolves a real reading for a day that has one, collapsed into one continuous text', () => {
const reading = getOctaveReading('st-lawrence', 2);
expect(reading?.source).toBe('Sermo sancti Augustíni Epíscopi.');
expect(reading?.text.la).toContain('Beatissimi Laurentii Martyris');
expect(reading?.text.en).toContain('most blessed Martyr, Lawrence');
expect(reading?.status.la).toBe('verified');
expect(reading?.status.en).toBe('verified');
expect(reading?.responsory?.la).toContain('Levíta Lauréntius');
});
it('is undefined, not a placeholder, for a day with no reading authored', () => {
expect(getOctaveReading('st-lawrence', 6)).toBeUndefined(); // Assumption's own day
expect(getOctaveReading('st-lawrence', 1)).toBeUndefined(); // the feast's own day, not an octave reading
expect(getOctaveReading('st-lawrence', 99)).toBeUndefined();
});
it('resolves the fuller reading for the octave\'s own concluding day distinctly from ordinary days', () => {
const reading = getOctaveReading('st-lawrence', 8);
expect(reading?.text.la).toContain('Ecclesiástici');
});
it('marks a reading with no sourced English translation as honestly missing, not duplicating the Latin', () => {
const reading = getOctaveReading('st-lawrence', 3);
expect(reading?.status.en).toBe('missing');
expect(reading?.text.en).toBeUndefined();
});
});