Repository navigation
Commit 92db4e7
authored
fix(home/kpi): format Current Coverage / Target with one decimal (#967)
* fix(home/kpi): format Current Coverage / Target with one decimal
When the backend returned a fractional `current_coverage` value, the
dashboard KPI tile rendered the raw float (e.g. `0.14648736342042862%`)
because the template literal `${data.current_coverage || 0}%` did no
formatting. Apply `.toFixed(1)` to both `current_coverage` and
`target_coverage` so the tile reads as e.g. `0.1%` / `80.0%`,
matching the convention already used in inventory.ts.
Regression test in dashboard.test.ts asserts the fractional input
renders as `0.1%` and never as the raw float.
* fix(api/test): repair Session.Role literal and gofmt drift
TestHandler_getPurchaseDetails_NotFound_IsClientError set a nonexistent
Session.Role field causing go vet to fail: the Session struct carries only
UserID/Email; admin is resolved via HasPermissionAPI. Drop the bogus field
and confer admin through mockAuth.grantAdmin() so the handler reaches the
GetExecutionByID not-found branch it asserts on.
Also split multi-statement-per-line entries in handler_purchases_guards_test.go
that caused gofmt to fail the pre-commit hook.1 parent 20ce559 commit 92db4e7
3 files changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
180 | 200 | | |
181 | 201 | | |
182 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
| 271 | + | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1643 | 1643 | | |
1644 | 1644 | | |
1645 | 1645 | | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
1646 | 1650 | | |
1647 | 1651 | | |
1648 | 1652 | | |
| |||
0 commit comments