mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
18 lines
541 B
TypeScript
18 lines
541 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { formatNextRun } from "../ui/src/ui/presenter.ts";
|
|
|
|
describe("formatNextRun", () => {
|
|
it("returns n/a for nullish values", () => {
|
|
expect(formatNextRun(null)).toBe("n/a");
|
|
expect(formatNextRun(undefined)).toBe("n/a");
|
|
});
|
|
|
|
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}, /);
|
|
expect(out).toContain("(");
|
|
expect(out).toContain(")");
|
|
});
|
|
});
|