From 1f526ed5d3a32944ec5e6a3d19efd137b511becb Mon Sep 17 00:00:00 2001 From: can1357 Date: Thu, 20 Aug 2026 06:38:51 +0200 Subject: [PATCH] test(coding-agent): updated test harnesses for composer shape methods - Add syncComposerShape and getComposerShapes stubs to test mocks and harnesses. --- .../test/modes/controllers/extension-ui-controller.test.ts | 1 + .../coding-agent/test/repro-issue-1020-ctx-shutdown.test.ts | 4 ++++ .../test/repro-issue-1955-sendmessage-double-render.test.ts | 2 ++ 3 files changed, 7 insertions(+) diff --git a/packages/coding-agent/test/modes/controllers/extension-ui-controller.test.ts b/packages/coding-agent/test/modes/controllers/extension-ui-controller.test.ts index 7f3aea80a..70e851270 100644 --- a/packages/coding-agent/test/modes/controllers/extension-ui-controller.test.ts +++ b/packages/coding-agent/test/modes/controllers/extension-ui-controller.test.ts @@ -50,6 +50,7 @@ function makeHarness() { uiContext = context; }, addAutocompleteProvider, + syncComposerShape: vi.fn(), } as unknown as InteractiveModeContext; const controller = new ExtensionUiController(ctx); diff --git a/packages/coding-agent/test/repro-issue-1020-ctx-shutdown.test.ts b/packages/coding-agent/test/repro-issue-1020-ctx-shutdown.test.ts index 2fdb8202d..75015f582 100644 --- a/packages/coding-agent/test/repro-issue-1020-ctx-shutdown.test.ts +++ b/packages/coding-agent/test/repro-issue-1020-ctx-shutdown.test.ts @@ -29,10 +29,12 @@ describe("issue #1020 - ctx.shutdown() in interactive mode", () => { ): void { capturedContextActions = contextActions; }, + getComposerShapes: () => [], }; const ctxStub = { shutdownRequested: false, + syncComposerShape: () => {}, session: { extensionRunner: fakeExtensionRunner, // other session fields are only touched lazily by other actions; we @@ -64,11 +66,13 @@ describe("issue #1020 - ctx.shutdown() in interactive mode", () => { capturedContextActions = contextActions; }, onError(_handler: (error: unknown) => void): void {}, + getComposerShapes: () => [], async emit(_event: unknown): Promise {}, }; const ctxStub = { shutdownRequested: false, + syncComposerShape: () => {}, session: { extensionRunner: fakeExtensionRunner, }, diff --git a/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts b/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts index 93a1d3466..488bdf126 100644 --- a/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts +++ b/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts @@ -85,6 +85,7 @@ function createHarness(): Harness { emit: async () => undefined, getMessageRenderer: () => undefined, getAssistantThinkingRenderers: () => undefined, + getComposerShapes: () => [], }; const sessionMock = { @@ -138,6 +139,7 @@ function createHarness(): Harness { setWorkingMessage: vi.fn(), setToolsExpanded: vi.fn(), toolOutputExpanded: false, + syncComposerShape: vi.fn(), hideThinkingBlock: false, showError: vi.fn(), editor: {