diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dashboard.mjs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_dashboard.mjs b/tests/test_dashboard.mjs index dac4e5b..2448c38 100644 --- a/tests/test_dashboard.mjs +++ b/tests/test_dashboard.mjs @@ -17,7 +17,7 @@ import assert from "node:assert/strict"; import { area, line, push, spendParts, batteryGlyph, HISTORY } from "../static/dashboard.js"; import { busy as printing } from "../static/modules/k1c.js"; -import { busy as building } from "../static/modules/sbbuilder.js"; +import { busy as building, planRows } from "../static/modules/sbbuilder.js"; import { busy as live } from "../static/modules/obs.js"; // push keeps the last HISTORY samples @@ -58,3 +58,9 @@ assert.equal(building({ jobs: [{ status: "running" }] }), true); assert.equal(building({ jobs: [{ status: "done" }] }), false); assert.equal(live({ connected: true, recording: true }), true); assert.equal(live({ connected: true, recording: false, streaming: false }), false); + +// planRows: results first, then the package building, the rest waiting +assert.deepEqual(planRows({ plan: ["a/x", "b/y", "c/z"], + progress: { results: { "a/x": "failed" }, current: "b/y" } }).map((r) => r.status), + ["failed", "building", "waiting"]); +assert.deepEqual(planRows(undefined), []); |
