diff --git a/changelog.d/fixes/10553-list-models-card-hardcoded-null.md b/changelog.d/fixes/10553-list-models-card-hardcoded-null.md new file mode 100644 index 0000000000..9f30aa6346 --- /dev/null +++ b/changelog.d/fixes/10553-list-models-card-hardcoded-null.md @@ -0,0 +1 @@ +- fix(dashboard): show the real model count on the "List Models" endpoint card instead of a permanent "—" (#10553) diff --git a/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx b/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx index f7785f1306..a670f9cc34 100644 --- a/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx +++ b/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx @@ -2069,7 +2069,8 @@ export default function APIPageClient({ machineId }: Readonly { + const cardMatch = source.match( + /title=\{t\("listModels"\)\}[\s\S]{0,200}?models=\{([^}]*)\}/ + ); + assert.ok(cardMatch, "List Models EndpointCard not found"); + assert.notStrictEqual(cardMatch[1].trim(), "null", "List Models card must not hardcode models={null}"); +}); + +test("issue #10553: List Models card passes modelsLoading", () => { + const cardMatch = source.match( + /title=\{t\("listModels"\)\}[\s\S]{0,250}?(modelsLoading=\{[^}]*\})/ + ); + assert.ok(cardMatch, "List Models card missing modelsLoading prop"); +});