feat: 添加全局人设与头像设置并优化对话及弹窗交互

This commit is contained in:
2026-09-05 22:26:12 +08:00
parent 7551716e13
commit a1ab1024f0
18 changed files with 450 additions and 22 deletions
+12 -1
View File
@@ -29,12 +29,23 @@ beforeEach(() => {
vi.spyOn(useSkillStore(), 'loadSkills').mockResolvedValue(undefined)
})
it('reuses the settings model cache and renders the shared select style', async () => {
const providers = useProviderStore()
providers.modelsByProvider.a = [{model_id:'a-default',name:'A model',capabilities:{chat:true}}]
const wrapper = mount(ChatView)
await flushPromises()
expect(providers.loadModels).not.toHaveBeenCalled()
expect(wrapper.get('select#chat-model-select').classes()).toContain('select')
expect(wrapper.get('select#chat-model-select').text()).toContain('A model')
wrapper.unmount()
})
it('preserves the selected provider and manual model after leaving and returning to chat', async () => {
const chat = useChatStore()
const first = mount(ChatView)
await flushPromises()
await first.get('select').setValue('b')
await first.get('input[list="chat-models"]').setValue('b-manual')
await first.get('input[data-field="manual-model"]').setValue('b-manual')
first.unmount()
const returned = mount(ChatView)
await flushPromises()