




















@@ -1,16 +1,18 @@
11import { describe, expect, it } from "vitest";
2+import { t } from "../ui/src/i18n/index.ts";
23import { formatNextRun } from "../ui/src/ui/presenter.ts";
3445describe("formatNextRun", () => {
5-it("returns n/a for nullish values", () => {
6-expect(formatNextRun(null)).toBe("n/a");
7-expect(formatNextRun(undefined)).toBe("n/a");
6+it("returns localized n/a for nullish values", () => {
7+expect(formatNextRun(null)).toBe(t("common.na"));
8+expect(formatNextRun(undefined)).toBe(t("common.na"));
89});
9101011it("includes weekday and relative time", () => {
1112const ts = Date.UTC(2026, 1, 23, 15, 0, 0);
1213const out = formatNextRun(ts);
13-expect(out).toMatch(/^[A-Za-z]{3}, /);
14+const weekday = new Date(ts).toLocaleDateString(undefined, { weekday: "short" });
15+expect(out.slice(0, weekday.length + 2)).toBe(`${weekday}, `);
1416expect(out).toContain("(");
1517expect(out).toContain(")");
1618});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。