fix: add headroom to dashboard bar scales

This commit is contained in:
inman committed 2026-09-02 11:28:47 +08:00
1 parent ed456e6a5d
commit 63b387f679
5 files changed
+96 -10

No files matched your search

@@ -248,10 +248,21 @@ test('operator UI exposes role-aware accounts, executive drill-through, original
assert.match(app, /business_route_id/);
assert.match(app, /data-operations-status|dataset\.operationsStatus/);
assert.match(app, /data-operations-business|dataset\.operationsBusiness/);
assert.match(app, /function operationsDashboardRankScale/);
assert.match(app, /operationsDashboardRankBar/);
assert.match(app, /operations-dashboard-rank-bar/);
assert.match(app, /sort\(\(left, right\) => Number\(right\.total/);
assert.doesNotMatch(app, /完成率|operationsDashboardCompletionRate|operationsDashboardDays/);
const rankScaleSource = app.slice(
app.indexOf('function operationsDashboardRankScale('),
app.indexOf('function operationsDashboardRankBar(')
);
const rankScale = Function(`${rankScaleSource}\nreturn operationsDashboardRankScale;`)() as (maximum: number) => number;
assert.equal(rankScale(0), 1);
assert.equal(rankScale(1), 2);
assert.equal(rankScale(43), 50);
assert.equal(rankScale(100), 120);
assert.equal(rankScale(359), 400);
assert.match(app, /function operationsDashboardReadableResult/);
assert.match(app, /function operationsDashboardReadableInput/);
assert.match(app, /原始输入/);