mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 21:36:07 +00:00
Refactor the Control UI around route-owned page lifecycle and state while preserving existing behavior and design.
Prepared head SHA: bd51b6fa76
Co-authored-by: Shakker <165377636+shakkernerd@users.noreply.github.com>
Reviewed-by: @shakkernerd
21 lines
791 B
TypeScript
21 lines
791 B
TypeScript
// UI presenter next-run tests cover presenter scheduling output.
|
|
import { describe, expect, it } from "vitest";
|
|
import { t } from "../ui/src/i18n/index.ts";
|
|
import { formatNextRun } from "../ui/src/lib/presenter.ts";
|
|
|
|
describe("formatNextRun", () => {
|
|
it("returns localized n/a for nullish values", () => {
|
|
expect(formatNextRun(null)).toBe(t("common.na"));
|
|
expect(formatNextRun(undefined)).toBe(t("common.na"));
|
|
});
|
|
|
|
it("includes weekday and relative time", () => {
|
|
const ts = Date.UTC(2026, 1, 23, 15, 0, 0);
|
|
const out = formatNextRun(ts);
|
|
const weekday = new Date(ts).toLocaleDateString(undefined, { weekday: "short" });
|
|
expect(out.slice(0, weekday.length + 2)).toBe(`${weekday}, `);
|
|
expect(out).toContain("(");
|
|
expect(out).toContain(")");
|
|
});
|
|
});
|