feat: open the next three months of Wednesday shifts on the public list

Volunteers can see who is signed up, and a full shift stays closed. Coordinators can see a contact's current and past shifts.
This commit is contained in:
blake committed 2026-10-26 15:45:32 -05:00
1 parent e7c99a788e
commit 1a8959c86a
26 files changed
+1402 -192

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { describe, expect, it } from 'vitest';
import { isWithinSignupWindow, signupDeadline, signupDeadlineLabel } from '../src/signup-window.js';
describe('signup window', () => {
it('opens signup through the same local date three months ahead', () => {
expect(signupDeadline('2026-10-14')).toBe('2027-01-14');
expect(signupDeadlineLabel('2026-10-14')).toBe('January 14, 2027');
expect(isWithinSignupWindow('2027-01-14', '2026-10-14')).toBe(true);
expect(isWithinSignupWindow('2027-01-15', '2026-10-14')).toBe(false);
});
it('uses the last valid day when the later month is shorter', () => {
expect(signupDeadline('2026-01-31')).toBe('2026-04-30');
expect(isWithinSignupWindow('2026-04-30', '2026-01-31')).toBe(true);
expect(isWithinSignupWindow('2026-05-01', '2026-01-31')).toBe(false);
});
});