mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
Label configured model aliases with an alias badge wherever a model id shows. List only providers with traffic in the window in provider chart legends. Page long tables, show a scroll shadow on wide ones and drop the duplicate model link. Show costs with thousands separators and magnitude-scaled decimals on cards and chart axes. Use whole-number ticks for count charts and replace all-zero charts with a message. Back off polling after failures. Keep the CSV status region from widening the page on phones. Regenerate admin_assets_gen.go.
19 lines
860 B
TypeScript
19 lines
860 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { aliasNameSet } from './alias'
|
|
import type { AdminAliasView } from '@/types/api'
|
|
|
|
const view = (alias: string): AdminAliasView => ({ alias, target: 'openai/gpt-5', modelMeta: {} })
|
|
|
|
describe('aliasNameSet', () => {
|
|
it.each<{ name: string; input: AdminAliasView[] | undefined; has: string[]; hasNot: string[] }>([
|
|
{ name: 'undefined', input: undefined, has: [], hasNot: ['x'] },
|
|
{ name: 'empty', input: [], has: [], hasNot: ['x'] },
|
|
{ name: 'two aliases', input: [view('fast'), view('smart')], has: ['fast', 'smart'], hasNot: ['openai/gpt-5', 'Fast', ''] },
|
|
])('$name', ({ input, has, hasNot }) => {
|
|
const set = aliasNameSet(input)
|
|
for (const h of has) expect(set.has(h)).toBe(true)
|
|
for (const h of hasNot.filter((x) => !has.includes(x))) expect(set.has(h)).toBe(false)
|
|
})
|
|
})
|