Files
vu/tests/propers/bible-plan.test.ts
T
will 64a5634557
Deploy / deploy (push) Successful in 1m51s
Collapse consecutive bible-plan chapters into a citation range
Multi-chapter readings (e.g. Job 34-37, authored as one YAML entry per
chapter) were rendering as "Job 34; Job 35; Job 36; Job 37" instead of
the compact "Job 34-37". Verse-qualified and non-consecutive citations
are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGjUyhUZJaSjiniEmnLdak
2026-09-03 11:46:34 -04:00

20 lines
744 B
TypeScript

import { describe, expect, it } from 'vitest';
import { getBiblePlanReadings } from '../../src/propers/bible-plan';
describe('getBiblePlanReadings citation labels', () => {
const readings = getBiblePlanReadings('post-pentecost-14', 'thursday', '2026-09-17');
it('collapses a consecutive multi-chapter run of the same book into a range', () => {
expect(readings[0]?.citation.la).toBe('Job 34-37');
expect(readings[0]?.citation.en).toBe('Job 34-37');
});
it('leaves a single-chapter reading unchanged', () => {
expect(readings[1]?.citation.la).toBe('Sir 42');
});
it('leaves a verse-qualified citation unchanged, never merged into a range', () => {
expect(readings[2]?.citation.la).toBe('Luke 18:1-23');
});
});