Files
fusion/packages/dashboard/app/utils/__tests__/providerIconKey.test.ts
gsxdsm 0a8a86cb05 FN-7217: map GLM models to Z.ai icons
Command Center token analytics now render standalone GLM model rows with Z.ai provider icons.

- Infer Z.ai provider icons for standalone glm-* model ids without matching unrelated text.
- Cover GLM icon rendering in Overview token bars and Tokens Area bars/table rows.
- Add a patch changeset for the published Fusion package.

Files changed:
 .changeset/fn-7217-zai-glm-icons.md                |  7 +++
 .../__tests__/CommandCenter.test.tsx               | 39 ++++++++++++++++
 .../areas/__tests__/TokensArea.test.tsx            | 53 ++++++++++++++++++++++
 .../app/utils/__tests__/providerIconKey.test.ts    |  4 ++
 packages/dashboard/app/utils/providerIconKey.ts    |  7 ++-
 5 files changed, 109 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-7217

Fusion-Task-Lineage: e784413e-2dcf-4b38-ba01-5f9d825e07b8

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-28 21:00:00 -07:00

37 lines
1.2 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { inferProviderIconKey } from "../providerIconKey";
describe("inferProviderIconKey", () => {
it.each([
["claude-sonnet-4-5", "anthropic"],
["Anthropic Claude", "anthropic"],
["gpt-4o", "openai"],
["openai-codex", "openai"],
["gemini-2.5-pro", "google"],
["google-antigravity", "google"],
["ollama/llama3", "ollama"],
["minimax-text-01", "minimax"],
["zhipu-glm-4", "zai"],
["zai/glm-4.5", "zai"],
["glm-5.1", "zai"],
["glm-4.5-air", "zai"],
["glm-5v-turbo", "zai"],
["kimi-k2", "kimi"],
["moonshot-v1", "kimi"],
["amazon-bedrock-claude", "anthropic"],
["bedrock-titan", "bedrock"],
["xai-grok-4", "xai"],
["opencode", "opencode"],
["github copilot", "github-copilot"],
["copilot-gpt-4", "openai"],
])("maps %s to %s", (input, expected) => {
expect(inferProviderIconKey(input)).toBe(expected);
});
it("returns unknown ids unchanged so ProviderIcon can render its fallback", () => {
expect(inferProviderIconKey("custom-model-v1")).toBe("custom-model-v1");
expect(inferProviderIconKey("not-a-glmish-model")).toBe("not-a-glmish-model");
expect(inferProviderIconKey("")).toBe("");
});
});