Public: anyone can read this; the crew can change it.
Sentinel: red:01m23vygyffx5hg2f5vm8r74sr is past its budget: trevato/forge: main is red at 15ed15b — "GET /api/v1/boards/:slug/panels/:id > a panel not grouped by time ignores the … #3934
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/3917-sentinel-red-01m23vygyffx5hg2f5vm8r74sr → main 2 commits fork
1 file
changed +8
−3
test/boards-panel-data.test.ts +8 −3
| @@ -159,7 +159,10 @@ describe("GET /api/v1/boards/:slug/panels/:id", () => { | ||
| 159 | 159 | expect(res.status).toBe(200); |
| 160 | 160 | const out = (await res.json()) as Out; |
| 161 | 161 | expect([out.board, out.panel, out.title, out.step]).toEqual(["usage-test", 0, "Pod CPU", 300]); |
| 162 | expect(out.rows.at(-1)!.group).toBe(minute(Math.floor(LAST / 300_000) * 300_000)); | |
| 162 | // The seed minute's bucket, or a later one if the clock crossed a 5-minute mark since the file loaded. | |
| 163 | const seeded = Math.floor(LAST / 300_000) * 300_000; | |
| 164 | const nowMark = Math.floor(Date.now() / 300_000) * 300_000; | |
| 165 | expect([minute(seeded), minute(nowMark)]).toContain(out.rows.at(-1)!.group); | |
| 163 | 166 | }); |
| 164 | 167 | |
| 165 | 168 | test("step=1m over 24 h is all 1440 minutes; step=5m over an aligned day is 288 buckets", async () => { |
| @@ -190,10 +193,12 @@ describe("GET /api/v1/boards/:slug/panels/:id", () => { | ||
| 190 | 193 | }); |
| 191 | 194 | |
| 192 | 195 | test("a panel not grouped by time ignores the step; a text cell is never a formula", async () => { |
| 193 | const out = (await (await api("/api/v1/boards/usage-test/panels/1?step=5m")).json()) as Out; | |
| 196 | // The day of points is pinned, so a minute turning over mid-run can't drop the oldest one. | |
| 197 | const day = `from=${new Date(LAST - 86_400_000).toISOString()}`; | |
| 198 | const out = (await (await api(`/api/v1/boards/usage-test/panels/1?step=5m&${day}`)).json()) as Out; | |
| 194 | 199 | expect(out.step).toBeNull(); |
| 195 | 200 | expect(out.rows.map((r) => r.group)).toEqual(['=HYPERLINK("x")', "forge"]); |
| 196 | const csv = await (await api("/api/v1/boards/usage-test/panels/1?format=csv")).text(); | |
| 201 | const csv = await (await api(`/api/v1/boards/usage-test/panels/1?format=csv&${day}`)).text(); | |
| 197 | 202 | expect(csv).toBe(`group,value\r\n"'=HYPERLINK(""x"")",1\r\nforge,1440\r\n`); |
| 198 | 203 | }); |
| 199 | 204 |
new above
offline