From e3b21387d0e58228c21bd13e705ce9088e461b66 Mon Sep 17 00:00:00 2001 From: jmoseley Date: Fri, 31 Jul 2026 10:12:07 -0700 Subject: [PATCH] Test extension canvas forwarding Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b804459e-2917-426f-9f9a-9eb9299cc808 --- nodejs/test/extension.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nodejs/test/extension.test.ts b/nodejs/test/extension.test.ts index e94ad2204f..4aceabb5e0 100644 --- a/nodejs/test/extension.test.ts +++ b/nodejs/test/extension.test.ts @@ -57,4 +57,25 @@ describe("joinSession", () => { expect(canvas.declaration.id).toBe("counter"); }); + + it("forwards canvas providers when joining as an extension", async () => { + process.env.SESSION_ID = "session-123"; + const resumeForExtension = vi + .spyOn(CopilotClient.prototype, "resumeSessionForExtension") + .mockResolvedValue({} as any); + const canvas = createCanvas({ + id: "counter", + displayName: "Counter", + description: "A counter canvas", + open: () => ({ url: "https://example.test/counter" }), + }); + + await joinSession({ canvases: [canvas] }); + + expect(resumeForExtension).toHaveBeenCalledWith( + "session-123", + expect.objectContaining({ canvases: [canvas] }), + undefined + ); + }); });