a5dc6502d7
Deploy / deploy (push) Failing after 1m8s
Client-side-first PWA (Vite/TS, no backend) per the approved plan: day- navigable shell listing all 8 hours, Prime fully resolves via the calendar -> psalter -> ordo pipeline, the other 7 hours are registered but flagged not-implemented. Sanctoral/temporal calendar data uses a day -> id indirection layer (saints, easter-offsets, fixed-date-calendar) so reassigning a feast to a different day is a data edit, not a code change. Docker (Caddy-serving-static) + Gitea CI workflow scaffolded to match the eec/drip/bookshop operational pattern. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
41 lines
1.3 KiB
TypeScript
41 lines
1.3 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('stubs season and occurring until milestone 4', () => {
|
|
const day = resolveDay('2026-08-09');
|
|
expect(day.date).toBe('2026-08-09');
|
|
expect(day.weekday).toBe('sunday');
|
|
expect(day.occurring).toEqual([]);
|
|
});
|
|
});
|