The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { formatNextScheduledTaskRun } from "./scheduledTaskPresentation"; |
| 4 | |
| 5 | describe("formatNextScheduledTaskRun", () => { |
| 6 | it("names the rounded unit for a run later today", () => { |
| 7 | const now = new Date(2026, 10, 3, 10, 0, 0).getTime(); |
| 8 | const at = (minutes: number) => new Date(now + minutes * 60_000).toISOString(); |
| 9 | expect(formatNextScheduledTaskRun(at(59), now)).toBe("Next run in 59 minutes"); |
| 10 | expect(formatNextScheduledTaskRun(at(59.5), now)).toBe("Next run in 1 hour"); |
| 11 | expect(formatNextScheduledTaskRun(at(150), now)).toBe("Next run in 3 hours"); |
| 12 | }); |
| 13 | }); |