Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ProviderInstanceIcon.test.ts

23 lines975 Bytes

1import { ProviderDriverKind } from "@t3tools/contracts";
2import { describe, expect, it } from "vite-plus/test";
3​
4import { resolveProviderInstanceAcpRegistryIconUrl } from "./ProviderInstanceIcon";
5​
6describe("resolveProviderInstanceAcpRegistryIconUrl", () => {
7 it("uses allowlisted catalog metadata and rejects untrusted overrides", () => {
8 expect(
9 resolveProviderInstanceAcpRegistryIconUrl({
10 driverKind: ProviderDriverKind.make("acpRegistry"),
11 agentId: "kilo",
12 iconUrl: "https://cdn.agentclientprotocol.com/registry/icons/kilo.svg",
13 }),
14 ).toBe("https://cdn.agentclientprotocol.com/registry/icons/kilo.svg");
15 expect(
16 resolveProviderInstanceAcpRegistryIconUrl({
17 driverKind: ProviderDriverKind.make("acpRegistry"),
18 agentId: "generic-agent",
19 iconUrl: "https://example.com/not-official.svg",
20 }),
21 ).toBe("https://cdn.agentclientprotocol.com/registry/v1/latest/generic-agent.svg");
22 });
23});