@@ -3,12 +3,20 @@ import { mount } from '@vue/test-utils'
33import { ref } from 'vue'
44import { ModelType } from '../../../src/shared/model'
55
6- const setup = async ( ) => {
6+ const setup = async (
7+ options : {
8+ currentMode ?: 'agent' | 'acp agent'
9+ props ?: Record < string , unknown >
10+ } = { }
11+ ) => {
712 vi . resetModules ( )
813
14+ const currentMode = options . currentMode ?? 'agent'
15+
916 vi . doMock ( '@/stores/providerStore' , ( ) => ( {
1017 useProviderStore : ( ) => ( {
1118 sortedProviders : [
19+ { id : 'acp' , name : 'ACP' , enable : true } ,
1220 { id : 'ollama' , name : 'Ollama' , enable : true } ,
1321 { id : 'openai' , name : 'OpenAI' , enable : true }
1422 ]
@@ -24,6 +32,10 @@ const setup = async () => {
2432 { id : 'deepseek-r1:1.5b' , name : 'deepseek-r1:1.5b' , type : 'chat' } ,
2533 { id : 'nomic-embed-text:latest' , name : 'nomic-embed-text:latest' , type : 'embedding' }
2634 ]
35+ } ,
36+ {
37+ providerId : 'acp' ,
38+ models : [ { id : 'acp-agent' , name : 'ACP Agent' , type : 'chat' } ]
2739 }
2840 ]
2941 } )
@@ -43,7 +55,7 @@ const setup = async () => {
4355
4456 vi . doMock ( '@/components/chat-input/composables/useChatMode' , ( ) => ( {
4557 useChatMode : ( ) => ( {
46- currentMode : ref ( 'agent' )
58+ currentMode : ref ( currentMode )
4759 } )
4860 } ) )
4961
@@ -74,7 +86,8 @@ const setup = async () => {
7486
7587 return mount ( ModelSelect , {
7688 props : {
77- type : [ ModelType . Chat ]
89+ type : [ ModelType . Chat ] ,
90+ ...options . props
7891 }
7992 } )
8093}
@@ -93,4 +106,17 @@ describe('ModelSelect', () => {
93106 [ { id : 'deepseek-r1:1.5b' , name : 'deepseek-r1:1.5b' , type : 'chat' } , 'ollama' ]
94107 ] )
95108 } )
109+
110+ it ( 'can ignore chat mode filtering for settings pickers' , async ( ) => {
111+ const wrapper = await setup ( {
112+ currentMode : 'acp agent' ,
113+ props : {
114+ excludeProviders : [ 'acp' ] ,
115+ respectChatMode : false
116+ }
117+ } )
118+
119+ expect ( wrapper . text ( ) ) . toContain ( 'deepseek-r1:1.5b' )
120+ expect ( wrapper . text ( ) ) . not . toContain ( 'ACP Agent' )
121+ } )
96122} )
0 commit comments