Files
tutti/packages/agent/gui/managedAgentIconAssets.spec.ts
agent-radar 2ed3415fb7
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

72 lines
2.6 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { agentGuiDockIconUrl, agentGuiDockIconUrls } from "./dockIcons.ts";
import {
claudeRoundedUrl,
codexRoundedUrl,
cursorColorfulUrl,
agentColorfulUrl,
manageAgentClaudeCodeUrl,
manageAgentCodexUrl,
manageAgentOpenCodeUrl,
manageAgentTuttiUrl,
manageAgentOpenclawUrl,
opencodeRoundedUrl,
tuttiDocRoundedUrl,
openclawRoundedUrl
} from "./managedAgentIconAssets.ts";
import {
MANAGED_AGENT_ICON_FALLBACK_URL,
MANAGED_AGENT_ICON_ROUNDED_URLS,
MANAGED_AGENT_ICON_URLS,
MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS
} from "./shared/managedAgentIcons.ts";
function expectPackagedIconUrl(url: string): void {
expect(url).toEqual(expect.any(String));
expect(url.length).toBeGreaterThan(0);
expect(url).not.toContain("undefined");
expect(url).not.toContain("/node_modules/.vite/deps/");
}
describe("managed agent icon assets", () => {
it("exposes concrete package icon URLs for every managed agent provider", () => {
[
...Object.values(MANAGED_AGENT_ICON_URLS),
...Object.values(MANAGED_AGENT_ICON_ROUNDED_URLS),
...Object.values(MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS),
MANAGED_AGENT_ICON_FALLBACK_URL,
agentGuiDockIconUrl,
...Object.values(agentGuiDockIconUrls)
]
.filter((url): url is string => typeof url === "string")
.forEach(expectPackagedIconUrl);
});
it("reuses identical provider artwork across manage, rounded, and dock maps", () => {
expect(manageAgentClaudeCodeUrl).toBe(claudeRoundedUrl);
expect(manageAgentCodexUrl).toBe(codexRoundedUrl);
expect(manageAgentTuttiUrl).toBe(tuttiDocRoundedUrl);
expect(manageAgentOpenclawUrl).toBe(openclawRoundedUrl);
expect(manageAgentOpenCodeUrl).toBe(opencodeRoundedUrl);
expect(agentGuiDockIconUrls["claude-code"]).toBe(claudeRoundedUrl);
expect(agentGuiDockIconUrls.codex).toBe(codexRoundedUrl);
expect(agentGuiDockIconUrls.nexight).toBe(tuttiDocRoundedUrl);
expect(agentGuiDockIconUrls.openclaw).toBe(openclawRoundedUrl);
expect(agentGuiDockIconUrls.opencode).toBe(opencodeRoundedUrl);
});
it("uses Cursor colorful artwork for rail and shared rounded avatars", () => {
expect(MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS.cursor).toBe(
cursorColorfulUrl
);
expect(MANAGED_AGENT_ICON_URLS.cursor).not.toBe(cursorColorfulUrl);
expect(MANAGED_AGENT_ICON_ROUNDED_URLS.cursor).toBe(cursorColorfulUrl);
});
it("uses neutral artwork rather than Tutti for unknown providers", () => {
expect(MANAGED_AGENT_ICON_FALLBACK_URL).toBe(agentColorfulUrl);
expect(MANAGED_AGENT_ICON_FALLBACK_URL).not.toBe(manageAgentTuttiUrl);
});
});