a492be961b
Deploy / deploy (push) Successful in 44s
11 collects, 4 antiphons -- including backfilling the three pre-existing August entries (Lawrence, Assumption, Augustine) now that the pulling methodology exists. Also updates three pre-existing tests whose dates collided with this month's new real content: the vigil-of-St.-Lawrence backward-transfer case now runs into a real feast at its landing day instead of an empty one (confirmed correct against the live reference engine, including the surviving commemoration on the impeded Sunday itself), and two other tests moved off Aug 9/10 to dates unaffected by the new data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
48 lines
1.7 KiB
TypeScript
48 lines
1.7 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { weekdayOf } from '../../src/calendar/weekday';
|
|
import { resolveDay } from '../../src/calendar';
|
|
|
|
describe('weekdayOf', () => {
|
|
it('resolves a known Sunday', () => {
|
|
// 2026-08-09 is a Sunday.
|
|
expect(weekdayOf('2026-08-09')).toBe('sunday');
|
|
});
|
|
|
|
it('resolves each day of a full week correctly', () => {
|
|
const expected = [
|
|
['2026-08-09', 'sunday'],
|
|
['2026-08-10', 'monday'],
|
|
['2026-08-11', 'tuesday'],
|
|
['2026-08-12', 'wednesday'],
|
|
['2026-08-13', 'thursday'],
|
|
['2026-08-14', 'friday'],
|
|
['2026-08-15', 'saturday'],
|
|
] as const;
|
|
for (const [date, weekday] of expected) {
|
|
expect(weekdayOf(date)).toBe(weekday);
|
|
}
|
|
});
|
|
|
|
it('is not affected by the local timezone offset', () => {
|
|
// Regression guard: resolving via `new Date(isoDate)` without pinning to
|
|
// UTC would give different weekdays depending on the host's timezone.
|
|
expect(weekdayOf('2026-01-01')).toBe('thursday');
|
|
});
|
|
});
|
|
|
|
describe('resolveDay', () => {
|
|
it('resolves a plain Sunday with no occurring feast', () => {
|
|
// Not 2026-08-09 (also a Sunday): since the August sanctoral pull, that
|
|
// date does carry a real commemoration (St. Romanus, impeded from
|
|
// winning by the Vigil of St. Lawrence, itself impeded by the Sunday
|
|
// and transferred away — see tests/calendar/transfer.test.ts, and
|
|
// confirmed against the live reference engine, which shows the same
|
|
// commemoration despite the vigil's own absence that day).
|
|
const day = resolveDay('2026-10-04');
|
|
expect(day.date).toBe('2026-10-04');
|
|
expect(day.weekday).toBe('sunday');
|
|
expect(day.winner.kind).toBe('temporal');
|
|
expect(day.commemorations).toEqual([]);
|
|
});
|
|
});
|