test(coding-agent): updated test harnesses for composer shape methods
- Add syncComposerShape and getComposerShapes stubs to test mocks and harnesses.
This commit is contained in:
@@ -50,6 +50,7 @@ function makeHarness() {
|
||||
uiContext = context;
|
||||
},
|
||||
addAutocompleteProvider,
|
||||
syncComposerShape: vi.fn(),
|
||||
} as unknown as InteractiveModeContext;
|
||||
|
||||
const controller = new ExtensionUiController(ctx);
|
||||
|
||||
@@ -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<void> {},
|
||||
};
|
||||
|
||||
const ctxStub = {
|
||||
shutdownRequested: false,
|
||||
syncComposerShape: () => {},
|
||||
session: {
|
||||
extensionRunner: fakeExtensionRunner,
|
||||
},
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user