From 6e809982e880daa8446fb7ef063ca4dc8666b0a0 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Wed, 19 Aug 2026 11:52:23 -0300 Subject: [PATCH] fix(dashboard): List Models card must not hardcode models={null} (#10553) (#10753) Co-authored-by: Markus Hartung --- .../10553-list-models-card-hardcoded-null.md | 1 + .../dashboard/endpoint/EndpointPageClient.tsx | 3 +- .../endpoint-list-models-card-10553.test.ts | 31 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 changelog.d/fixes/10553-list-models-card-hardcoded-null.md create mode 100644 tests/unit/dashboard/endpoint-list-models-card-10553.test.ts 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"); +});