@@ -2,6 +2,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
22import {
33 buildLiveNvidiaProvider ,
44 buildNvidiaProvider ,
5+ buildSelectableLiveNvidiaProvider ,
56 clearNvidiaFeaturedModelCacheForTests ,
67 NVIDIA_FEATURED_MODELS_URL ,
78} from "./provider-catalog.js" ;
@@ -73,10 +74,6 @@ describe("nvidia provider catalog", () => {
7374 expect ( provider . models . map ( ( model ) => model . id ) ) . toEqual ( [
7475 "z-ai/glm-5.1" ,
7576 "nvidia/nemotron-3-super-120b-a12b" ,
76- "moonshotai/kimi-k2.5" ,
77- "minimaxai/minimax-m2.7" ,
78- "minimaxai/minimax-m2.5" ,
79- "z-ai/glm5" ,
8077 ] ) ;
8178 expect ( provider . models [ 0 ] ) . toMatchObject ( {
8279 name : "GLM 5.1" ,
@@ -118,6 +115,40 @@ describe("nvidia provider catalog", () => {
118115 ) ;
119116 } ) ;
120117
118+ it ( "uses only selectable live catalog rows when the featured catalog returns models" , async ( ) => {
119+ mockFeaturedCatalogResponse ( {
120+ "featured-models" : [
121+ {
122+ model : "z-ai/glm-5.1" ,
123+ "model-name" : "GLM 5.1" ,
124+ context : 202752 ,
125+ "max-output" : 8192 ,
126+ } ,
127+ {
128+ model : "nemotron-3-super-120b-a12b" ,
129+ "model-name" : "Nemotron 3 Super 120B" ,
130+ context : 262144 ,
131+ "max-output" : 8192 ,
132+ } ,
133+ ] ,
134+ } ) ;
135+
136+ const provider = await buildSelectableLiveNvidiaProvider ( ) ;
137+
138+ expect ( provider . models . map ( ( model ) => model . id ) ) . toEqual ( [
139+ "z-ai/glm-5.1" ,
140+ "nvidia/nemotron-3-super-120b-a12b" ,
141+ ] ) ;
142+ } ) ;
143+
144+ it ( "returns no selectable live rows when the featured catalog is unavailable" , async ( ) => {
145+ mockFeaturedCatalogResponse ( { error : "unavailable" } , 503 ) ;
146+
147+ const provider = await buildSelectableLiveNvidiaProvider ( ) ;
148+
149+ expect ( provider . models . map ( ( model ) => model . id ) ) . toEqual ( [ ] ) ;
150+ } ) ;
151+
121152 it ( "ignores malformed featured catalog rows and keeps valid entries" , async ( ) => {
122153 mockFeaturedCatalogResponse ( {
123154 "featured-models" : [
@@ -144,14 +175,7 @@ describe("nvidia provider catalog", () => {
144175
145176 const provider = await buildLiveNvidiaProvider ( ) ;
146177
147- expect ( provider . models . map ( ( model ) => model . id ) ) . toEqual ( [
148- "minimaxai/minimax-m2.7" ,
149- "nvidia/nemotron-3-super-120b-a12b" ,
150- "moonshotai/kimi-k2.5" ,
151- "z-ai/glm-5.1" ,
152- "minimaxai/minimax-m2.5" ,
153- "z-ai/glm5" ,
154- ] ) ;
178+ expect ( provider . models . map ( ( model ) => model . id ) ) . toEqual ( [ "minimaxai/minimax-m2.7" ] ) ;
155179 } ) ;
156180
157181 it ( "caches the featured catalog for repeated provider builds" , async ( ) => {
0 commit comments