Skip to content

Commit fc241ef

Browse files
committed
test(core): add ProxiedCopilotRuntimeAgent capabilities tests
1 parent 2f38e94 commit fc241ef

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

packages/core/src/__tests__/proxied-runtime-transport.test.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,67 @@ describe("ProxiedCopilotRuntimeAgent transport integration", () => {
174174
});
175175
});
176176

177+
describe("ProxiedCopilotRuntimeAgent capabilities", () => {
178+
const capabilitiesFixture = {
179+
tools: { supported: true, clientProvided: true },
180+
transport: { streaming: true },
181+
};
182+
183+
it("returns capabilities from the getter when constructed with capabilities", () => {
184+
const agent = new ProxiedCopilotRuntimeAgent({
185+
runtimeUrl: "http://localhost:3000",
186+
agentId: "test-agent",
187+
description: "Test agent",
188+
capabilities: capabilitiesFixture,
189+
});
190+
191+
expect(agent.capabilities).toEqual(capabilitiesFixture);
192+
});
193+
194+
it("returns capabilities from getCapabilities() when constructed with capabilities", async () => {
195+
const agent = new ProxiedCopilotRuntimeAgent({
196+
runtimeUrl: "http://localhost:3000",
197+
agentId: "test-agent",
198+
description: "Test agent",
199+
capabilities: capabilitiesFixture,
200+
});
201+
202+
await expect(agent.getCapabilities()).resolves.toEqual(capabilitiesFixture);
203+
});
204+
205+
it("returns undefined from the getter when constructed without capabilities", () => {
206+
const agent = new ProxiedCopilotRuntimeAgent({
207+
runtimeUrl: "http://localhost:3000",
208+
agentId: "test-agent",
209+
description: "Test agent",
210+
});
211+
212+
expect(agent.capabilities).toBeUndefined();
213+
});
214+
215+
it("returns {} from getCapabilities() when constructed without capabilities", async () => {
216+
const agent = new ProxiedCopilotRuntimeAgent({
217+
runtimeUrl: "http://localhost:3000",
218+
agentId: "test-agent",
219+
description: "Test agent",
220+
});
221+
222+
await expect(agent.getCapabilities()).resolves.toEqual({});
223+
});
224+
225+
it("clone() preserves capabilities", () => {
226+
const agent = new ProxiedCopilotRuntimeAgent({
227+
runtimeUrl: "http://localhost:3000",
228+
agentId: "test-agent",
229+
description: "Test agent",
230+
capabilities: capabilitiesFixture,
231+
});
232+
233+
const cloned = agent.clone();
234+
expect(cloned.capabilities).toEqual(capabilitiesFixture);
235+
});
236+
});
237+
177238
describe("ProxiedCopilotRuntimeAgent cloning", () => {
178239
const originalFetch = global.fetch;
179240
const runtimeUrl = "https://runtime.example/single";

0 commit comments

Comments
 (0)