mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 09:57:47 +08:00
fix(usage): show retry marker with fallback
This commit is contained in:
@@ -74,14 +74,15 @@ vi.mock('lucide-vue-next', async () => {
|
||||
const { defineComponent, h } = await import('vue')
|
||||
const Icon = defineComponent({
|
||||
name: 'IconStub',
|
||||
setup() {
|
||||
return () => h('span')
|
||||
setup(_, { attrs }) {
|
||||
return () => h('span', attrs)
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
RefreshCcw: Icon,
|
||||
Search: Icon,
|
||||
Shuffle: Icon,
|
||||
ChevronDown: Icon,
|
||||
Check: Icon,
|
||||
}
|
||||
@@ -180,7 +181,8 @@ describe('UsageRecordsTable', () => {
|
||||
.filter((element) => element.textContent?.trim() === '100 tps')
|
||||
expect(tpsElements.some((element) => element.classList.contains('text-[11px]'))).toBe(false)
|
||||
|
||||
const titles = [...root.querySelectorAll<HTMLElement>('[title]')].map((element) => element.title)
|
||||
const titles = [...root.querySelectorAll<HTMLElement>('[title]')]
|
||||
.map((element) => element.getAttribute('title'))
|
||||
expect(titles).toContain([
|
||||
'首字: 0.50s',
|
||||
'总耗时: 1.00s',
|
||||
@@ -271,4 +273,14 @@ describe('UsageRecordsTable', () => {
|
||||
expect(root.textContent).toContain('Jina Embedding')
|
||||
expect(root.textContent).toContain('Doubao Embedding')
|
||||
})
|
||||
|
||||
it('shows retry and fallback markers together when both flags are set', () => {
|
||||
const root = mountUsageRecordsTable([buildRecord({
|
||||
has_fallback: true,
|
||||
has_retry: true,
|
||||
})])
|
||||
|
||||
expect(root.querySelector('[data-usage-attempt-marker="fallback"]')).not.toBeNull()
|
||||
expect(root.querySelector('[data-usage-attempt-marker="retry"]')).not.toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user