| 1 | import { expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { formatCompactElapsedSeconds } from "./AgentElapsed"; |
| 4 | |
| 5 | it.each([ |
| 6 | [45, "45s"], |
| 7 | [90, "1m"], |
| 8 | [59 * 60 + 59, "59m"], |
| 9 | [60 * 60, "1h"], |
| 10 | [90 * 60, "1.5h"], |
| 11 | [119 * 60, "1.9h"], |
| 12 | [14 * 60 * 60 + 40 * 60, "14h"], |
| 13 | ])("formats %ss as %s", (seconds, label) => { |
| 14 | expect(formatCompactElapsedSeconds(seconds)).toBe(label); |
| 15 | }); |