diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-12 19:07:11 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-12 19:07:11 +0100 |
| commit | 7ac7a0326387012b1aad6ebc692c26b5620289b4 (patch) | |
| tree | ea6dc5b7ac0b0396540a0282cfb0bd091713b50a /tests | |
| parent | 53c4a434a8587a531c288e98875ab76c180d376a (diff) | |
| download | deck-it-7ac7a0326387012b1aad6ebc692c26b5620289b4.tar.gz deck-it-7ac7a0326387012b1aad6ebc692c26b5620289b4.zip | |
fix(dashboard): stroke only the top of the chip graphs
The CPU, GPU and network graphs stroked their closed area path, so the
outline also ran along the bottom edge and up the left side while the
history filled. Each series is now a filled area and an open line
through the samples, and only the line is stroked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dashboard.mjs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_dashboard.mjs b/tests/test_dashboard.mjs index 2fc19eb..dac4e5b 100644 --- a/tests/test_dashboard.mjs +++ b/tests/test_dashboard.mjs @@ -15,7 +15,7 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import assert from "node:assert/strict"; -import { area, push, spendParts, batteryGlyph, HISTORY } from "../static/dashboard.js"; +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 live } from "../static/modules/obs.js"; @@ -32,6 +32,11 @@ const d = area([0, 10], 10); assert.match(d, /^M[\d.]+,100 /); assert.match(d, / L120,100 Z$/); assert.ok(d.includes(",12"), "the max sample sits at 12% from the top"); +// line: the same samples, open, so no bottom or side edge is stroked +assert.equal(line([], 10), ""); +const l = line([0, 10], 10); +assert.match(l, /^M[\d.]+,100 L120,12$/); +assert.ok(d.includes(l.slice(1)), "area follows line"); // spendParts: top 3 paid models, then "other" with the rest const models = [5, 4, 3, 2, 1, 0].map((c, i) => ({ model: `m${i}`, cost: c })); |
