const { parsePayMonth } = require("../../../src/services/payroll"); describe("pay month UTC boundaries", () => { it.each([ ["2024-02", "2024-02-29T23:59:59.999Z"], ["2026-02", "2026-02-28T23:59:59.999Z"], ["2024-12", "2024-12-31T23:59:59.999Z"], ])("keeps exact leap/month-end %s", (month, end) => { const result = parsePayMonth(month); expect(result.value).toBe(month); expect(result.startDate.toISOString()).toBe(`${month}-01T00:00:00.000Z`); expect(result.endDate.toISOString()).toBe(end); }); it.each(["2026-00", "2026-13", "2026-1", "", undefined, null])("rejects invalid month %s", (input) => { expect(parsePayMonth(input)).toBeNull(); }); });