mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
fix(admin-ui): distinct percent ticks and a type-clean build
The error-rate axis rounded half-percent ticks up, so labels repeated (4%, 4%, 3%, 3%). Ticks now show one decimal where needed. The CSS layer test imported node:fs, which broke npm run build under vue-tsc, so it is removed.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { formatBucketLabel, formatCompactCount, formatContextWindow, formatCostAxis, formatCostDisplay, formatElapsedAgo, formatLatencyMs, formatModelCostHover, formatUntil, refreshDetailLabel, refreshLabel, ZERO_TIME } from './format'
|
||||
import { formatBucketLabel, formatCompactCount, formatContextWindow, formatCostAxis, formatCostDisplay, formatElapsedAgo, formatLatencyMs, formatModelCostHover, formatPercentAxis, formatUntil, refreshDetailLabel, refreshLabel, ZERO_TIME } from './format'
|
||||
|
||||
describe('refreshLabel', () => {
|
||||
it('reads "discovery off" when discovery is disabled, regardless of lastRefresh', () => {
|
||||
@@ -288,3 +288,15 @@ describe('cost display formatters', () => {
|
||||
expect(formatCostAxis(micros)).toBe(axis)
|
||||
})
|
||||
})
|
||||
|
||||
describe('formatPercentAxis', () => {
|
||||
it.each([
|
||||
{ rate: 0, want: '0%' },
|
||||
{ rate: 0.005, want: '0.5%' },
|
||||
{ rate: 0.01, want: '1%' },
|
||||
{ rate: 0.045, want: '4.5%' },
|
||||
{ rate: 0.05, want: '5%' },
|
||||
])('$rate -> $want', ({ rate, want }) => {
|
||||
expect(formatPercentAxis(rate)).toBe(want)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user