Files
hapi/web/src/components/AssistantChat/claudeModelOptions.test.ts
T
2026-04-25 10:48:12 +08:00

32 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { getClaudeComposerModelOptions, getNextClaudeComposerModel } from './claudeModelOptions'
describe('getClaudeComposerModelOptions', () => {
it('includes the active non-preset Claude model in the options list', () => {
expect(getClaudeComposerModelOptions('claude-opus-4-1-20250805')).toEqual([
{ value: null, label: 'Default' },
{ value: 'claude-opus-4-1-20250805', label: 'claude-opus-4-1-20250805' },
{ value: 'sonnet', label: 'Sonnet' },
{ value: 'sonnet[1m]', label: 'Sonnet 1M' },
{ value: 'opus', label: 'Opus' },
{ value: 'opus[1m]', label: 'Opus 1M' },
])
})
it('does not duplicate preset Claude models', () => {
expect(getClaudeComposerModelOptions('opus')).toEqual([
{ value: null, label: 'Default' },
{ value: 'sonnet', label: 'Sonnet' },
{ value: 'sonnet[1m]', label: 'Sonnet 1M' },
{ value: 'opus', label: 'Opus' },
{ value: 'opus[1m]', label: 'Opus 1M' },
])
})
})
describe('getNextClaudeComposerModel', () => {
it('cycles from a non-preset Claude model to the next selectable model instead of auto', () => {
expect(getNextClaudeComposerModel('claude-opus-4-1-20250805')).toBe('sonnet')
})
})