Files
fusion/packages/dashboard/app/utils/__tests__/providerIconKey.test.ts
gsxdsm 927f2baf7d FN-8354: add Oh My Pi provider logo
Render the official Oh My Pi mark throughout provider selection and analytics surfaces.

- Add a tokenized OMP SVG icon and provider aliases.
- Infer OMP-tagged model identifiers without misattributing bare models.
- Cover OMP icon rendering and inference with dashboard tests.

Files changed:
 packages/dashboard/app/components/ProviderIcon.tsx | 26 +++++++++++++++++++++-
 .../app/components/__tests__/ProviderIcon.test.tsx | 23 +++++++++++++++++++
 packages/dashboard/app/styles.css                  |  1 +
 .../app/utils/__tests__/providerIconKey.test.ts    |  8 +++++++
 packages/dashboard/app/utils/providerIconKey.ts    |  9 ++++++++
 5 files changed, 66 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-8354

Fusion-Task-Lineage: 71d5638c-b41e-4960-9391-c7a441d04f51

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-18 18:58:44 -07:00

49 lines
1.7 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"],
["cursor", "cursor-cli"],
["Cursor", "cursor-cli"],
["cursor-agent", "cursor-cli"],
["cursor/gpt-5", "cursor-cli"],
["omp-cli/MiniMax-M2.5", "omp-cli"],
["omp/claude-sonnet-4", "omp-cli"],
["Oh My Pi", "omp-cli"],
["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("does not attribute bare model ids to OMP", () => {
expect(inferProviderIconKey("MiniMax-M2.5")).toBe("minimax");
expect(inferProviderIconKey("claude-sonnet-4")).not.toBe("omp-cli");
});
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("");
});
});