fix: 加固日历日期与动态错误合同(09-05-error-explainability-payment-readiness,09-08-reimbursement-payment-closeout)
这个提交包含在:
@@ -0,0 +1,12 @@
|
||||
const { isValidDateOnlyString, parseDateOnlyString } = require("../../../src/utils/date");
|
||||
|
||||
describe("strict calendar date validation", () => {
|
||||
it.each(["2024-02-29", "2000-02-29", "2026-04-30", "2026-12-31", "0099-01-01"])("accepts %s without timezone shifts", (value) => {
|
||||
expect(isValidDateOnlyString(value)).toBe(true);
|
||||
expect(parseDateOnlyString(value).toISOString()).toBe(`${value}T00:00:00.000Z`);
|
||||
});
|
||||
|
||||
it.each(["2026-02-30", "2026-02-29", "1900-02-29", "2026-04-31", "2026-13-01", "2026-00-01", "2026-01-00", "2026-01-32", "2026-1-01", " 2026-01-01", "2026-01-01T00:00:00Z", "", null, undefined, 20260101])("rejects invalid input %s", (value) => {
|
||||
expect(isValidDateOnlyString(value)).toBe(false);
|
||||
});
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户