test: fix ui presenter next run test for multi-language environments

This commit is contained in:
郑苏波 (Super Zheng)
2026-04-03 18:32:51 +08:00
committed by George Zhang
parent 576dbdeef7
commit 3e2e78c43b

View File

@@ -10,7 +10,8 @@ describe("formatNextRun", () => {
it("includes weekday and relative time", () => {
const ts = Date.UTC(2026, 1, 23, 15, 0, 0);
const out = formatNextRun(ts);
expect(out).toMatch(/^[A-Za-z]{3}, /);
const weekday = new Date(ts).toLocaleDateString(undefined, { weekday: "short" });
expect(out.slice(0, weekday.length + 2)).toBe(`${weekday}, `);
expect(out).toContain("(");
expect(out).toContain(")");
});