fix(frontend): 补充 Claude Sonnet 5 状态别名

This commit is contained in:
hansnow
2026-07-28 18:17:38 +08:00
parent 2e432173f7
commit 32618e71e4
2 changed files with 31 additions and 0 deletions
@@ -229,6 +229,7 @@ const formatScopeName = (scope: string): string => {
'claude-sonnet-4-6': 'CSon46',
'claude-sonnet-4-5': 'CSon45',
'claude-sonnet-4-5-thinking': 'CSon45T',
'claude-sonnet-5': 'CSon5',
// Gemini 2.5 系列
'gemini-2.5-flash': 'G25F',
'gemini-2.5-flash-lite': 'G25FL',
@@ -51,6 +51,36 @@ function makeAccount(overrides: Partial<Account>): Account {
}
describe('AccountStatusIndicator', () => {
it('Claude 5 模型限流时显示 Opus 和 Sonnet 的短别名', () => {
const wrapper = mount(AccountStatusIndicator, {
props: {
account: makeAccount({
extra: {
model_rate_limits: {
'claude-opus-5': {
rate_limited_at: '2026-07-28T00:00:00Z',
rate_limit_reset_at: '2099-07-28T00:00:00Z'
},
'claude-sonnet-5': {
rate_limited_at: '2026-07-28T00:00:00Z',
rate_limit_reset_at: '2099-07-28T00:00:00Z'
}
}
}
})
},
global: {
stubs: {
Icon: true
}
}
})
expect(wrapper.text()).toContain('COpus5')
expect(wrapper.text()).toContain('CSon5')
expect(wrapper.text()).not.toContain('claude-sonnet-5')
})
it('Grok 账号额度限流时显示自动恢复时间而非临时不可调度', () => {
const wrapper = mount(AccountStatusIndicator, {
props: {