@@ -3043,8 +3043,8 @@ ${' '.repeat(8)}}
30433043 isCachedModelsValidStub . returns ( true )
30443044 const cachedData = {
30453045 models : [
3046- { id : 'model1' , name : 'Model 1' } ,
3047- { id : 'model2' , name : 'Model 2' } ,
3046+ { id : 'model1' , name : 'Model 1' , description : 'Test description 1' } ,
3047+ { id : 'model2' , name : 'Model 2' , description : 'Test description 2' } ,
30483048 ] ,
30493049 defaultModelId : 'model1' ,
30503050 timestamp : Date . now ( ) ,
@@ -3128,8 +3128,16 @@ ${' '.repeat(8)}}
31283128
31293129 const mockApiResponse = {
31303130 models : {
3131- 'claude-3-sonnet' : { modelId : 'claude-3-sonnet' } ,
3132- 'claude-4-sonnet' : { modelId : 'claude-4-sonnet' } ,
3131+ 'claude-3-sonnet' : {
3132+ modelId : 'claude-3-sonnet' ,
3133+ modelName : 'Claude 3 Sonnet' ,
3134+ description : 'Advanced AI model' ,
3135+ } ,
3136+ 'claude-4-sonnet' : {
3137+ modelId : 'claude-4-sonnet' ,
3138+ modelName : 'Claude 4 Sonnet' ,
3139+ description : 'Latest AI model' ,
3140+ } ,
31333141 } ,
31343142 defaultModel : { modelId : 'claude-3-sonnet' } ,
31353143 }
@@ -3147,8 +3155,8 @@ ${' '.repeat(8)}}
31473155 assert . strictEqual ( result . tabId , mockTabId )
31483156 assert . strictEqual ( result . models . length , 2 )
31493157 assert . deepStrictEqual ( result . models , [
3150- { id : 'claude-3-sonnet' , name : 'claude-3-sonnet ' } ,
3151- { id : 'claude-4-sonnet' , name : 'claude-4-sonnet ' } ,
3158+ { id : 'claude-3-sonnet' , name : 'Claude 3 Sonnet' , description : 'Advanced AI model ' } ,
3159+ { id : 'claude-4-sonnet' , name : 'Claude 4 Sonnet' , description : 'Latest AI model ' } ,
31523160 ] )
31533161
31543162 // Verify cache was updated
@@ -3163,7 +3171,7 @@ ${' '.repeat(8)}}
31633171
31643172 // Verify fallback to FALLBACK_MODEL_OPTIONS
31653173 assert . strictEqual ( result . tabId , mockTabId )
3166- assert . strictEqual ( result . models . length , 2 ) // FALLBACK_MODEL_OPTIONS length
3174+ assert . strictEqual ( result . models . length , 1 ) // FALLBACK_MODEL_OPTIONS length
31673175
31683176 // Verify cache was not updated due to error
31693177 sinon . assert . notCalled ( setCachedModelsStub )
@@ -3230,7 +3238,7 @@ ${' '.repeat(8)}}
32303238
32313239 it ( 'should fall back to default model when session has no modelId and no defaultModelId in cache' , async ( ) => {
32323240 getCachedModelsStub . returns ( {
3233- models : [ { id : 'model1' , name : 'Model 1' } ] ,
3241+ models : [ { id : 'model1' , name : 'Model 1' , description : 'Test model' } ] ,
32343242 defaultModelId : undefined , // No default model
32353243 timestamp : Date . now ( ) ,
32363244 } )
0 commit comments