@@ -38,51 +38,50 @@ test('日报导出目录应从 AI 设置移到存储设置', async () => {
3838 assert . match ( storageSource , / s e t t i n g s S t o r a g e \. m o d e A l l D e s c / ) ;
3939} ) ;
4040
41- test ( 'Ollama 提供商应支持获取模型列表并保留手动输入回退 ' , async ( ) => {
41+ test ( '所有提供商应支持获取模型列表并保留手动输入回退 ' , async ( ) => {
4242 const source = await readFile (
4343 new URL ( './components/SettingsAI.svelte' , import . meta. url ) ,
4444 'utf8'
4545 ) ;
4646
47- assert . match ( source , / i n v o k e \( ' g e t _ o l l a m a _ m o d e l s ' / ) ;
48- assert . match ( source , / r e f r e s h O l l a m a M o d e l s / ) ;
49- assert . match ( source , / o l l a m a M o d e l s / ) ;
50- assert . match ( source , / p r o v i d e r = = = ' o l l a m a ' / ) ;
47+ assert . match ( source , / i n v o k e \( ' f e t c h _ m o d e l s ' / ) ;
48+ assert . match ( source , / r e f r e s h M o d e l s / ) ;
49+ assert . match ( source , / f e t c h e d M o d e l s / ) ;
5150 assert . match ( source , / < s e l e c t / ) ;
5251 assert . match ( source , / s e t t i n g s A I \. m a n u a l M o d e l / ) ;
5352 assert . match ( source , / s e t t i n g s A I \. r e f r e s h M o d e l s / ) ;
5453} ) ;
5554
56- test ( 'Ollama 刷新模型列表后应给出反馈并在当前模型失效时自动回填可用模型' , async ( ) => {
55+ test ( '刷新模型列表后应给出反馈并在当前模型失效时自动回填可用模型' , async ( ) => {
5756 const source = await readFile (
5857 new URL ( './components/SettingsAI.svelte' , import . meta. url ) ,
5958 'utf8'
6059 ) ;
6160
62- assert . match ( source , / ! o l l a m a M o d e l s .i n c l u d e s \( c o n f i g \. t e x t _ m o d e l \. m o d e l \) / ) ;
61+ assert . match ( source , / ! f e t c h e d M o d e l s \ .i n c l u d e s \( c o n f i g \. t e x t _ m o d e l \. m o d e l \) / ) ;
6362 assert . match ( source , / s e t t i n g s A I \. l o a d e d M o d e l s / ) ;
6463} ) ;
6564
66- test ( 'Ollama 模型列表为空时应保留当前模型值,避免下拉框显示空白' , async ( ) => {
65+ test ( '模型列表为空时应保留当前模型值,避免下拉框显示空白' , async ( ) => {
6766 const source = await readFile (
6867 new URL ( './components/SettingsAI.svelte' , import . meta. url ) ,
6968 'utf8'
7069 ) ;
7170
72- assert . match ( source , / l e t s e l e c t e d O l l a m a M o d e l = ' ' ; / ) ;
73- assert . match ( source , / f u n c t i o n g e t O l l a m a F a l l b a c k O p t i o n L a b e l \( \) / ) ;
71+ assert . match ( source , / l e t s e l e c t e d M o d e l = ' ' ; / ) ;
72+ assert . match ( source , / f u n c t i o n g e t M o d e l F a l l b a c k O p t i o n L a b e l \( \) / ) ;
7473 assert . match ( source , / s e t t i n g s A I \. c u r r e n t M o d e l L o a d i n g / ) ;
7574 assert . match ( source , / s e t t i n g s A I \. c u r r e n t M o d e l M i s s i n g / ) ;
76- assert . match ( source , / \{ g e t O l l a m a F a l l b a c k O p t i o n L a b e l \( \) \} / ) ;
75+ assert . match ( source , / \{ g e t M o d e l F a l l b a c k O p t i o n L a b e l \( \) \} / ) ;
7776} ) ;
7877
79- test ( 'Ollama 下拉列表应只展示实际返回的模型,并明确区分手动输入值' , async ( ) => {
78+ test ( '下拉列表应只展示实际返回的模型,并明确区分手动输入值' , async ( ) => {
8079 const source = await readFile (
8180 new URL ( './components/SettingsAI.svelte' , import . meta. url ) ,
8281 'utf8'
8382 ) ;
8483
85- assert . doesNotMatch ( source , / r e t u r n \[ c o n f i g \. t e x t _ m o d e l \. m o d e l , \. \. \. o l l a m a M o d e l s \] ; / ) ;
84+ assert . doesNotMatch ( source , / r e t u r n \[ c o n f i g \. t e x t _ m o d e l \. m o d e l , \. \. \. f e t c h e d M o d e l s \] ; / ) ;
8685 assert . match ( source , / s e t t i n g s A I \. m a n u a l M o d e l M i s s i n g / ) ;
87- assert . match ( source , / # e a c h o l l a m a M o d e l s a s m o d e l \( m o d e l \) / ) ;
86+ assert . match ( source , / # e a c h f e t c h e d M o d e l s a s m o d e l \( m o d e l \) / ) ;
8887} ) ;
0 commit comments