{"version":3,"file":"interactive-mode-steer.test.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-steer.test.ts"],"names":[],"mappings":"","sourcesContent":["import { Container } from \"@apholdings/jensen-tui\";\nimport { describe, expect, it, vi } from \"vitest\";\nimport { InteractiveMode } from \"./interactive-mode.js\";\n\ndescribe(\"InteractiveMode /steer command\", () => {\n\tit(\"routes /steer through the interactive command surface and resumes the active workstream\", async () => {\n\t\tconst steer = vi.fn<(message: string) => Promise<void>>().mockResolvedValue(undefined);\n\t\tconst continueCurrentWork = vi.fn<() => Promise<void>>().mockResolvedValue(undefined);\n\t\tconst updatePendingMessagesDisplay = vi.fn();\n\n\t\tconst mode = Object.assign(Object.create(InteractiveMode.prototype), {\n\t\t\tchatContainer: new Container(),\n\t\t\tshowWarning: vi.fn(),\n\t\t\tui: { requestRender: vi.fn() },\n\t\t\tupdatePendingMessagesDisplay,\n\t\t\tsession: {\n\t\t\t\tisStreaming: false,\n\t\t\t\tstate: { messages: [{ role: \"assistant\" }] },\n\t\t\t\tsteer,\n\t\t\t\tgetSteeringMessages: () => [],\n\t\t\t\tagent: {\n\t\t\t\t\tcontinue: continueCurrentWork,\n\t\t\t\t},\n\t\t\t},\n\t\t}) as unknown as {\n\t\t\thandleSteerCommand: (text: string) => Promise<void>;\n\t\t\tchatContainer: Container;\n\t\t};\n\n\t\tawait mode.handleSteerCommand(\"/steer keep the patch focused\");\n\n\t\texpect(steer).toHaveBeenCalledWith(\"keep the patch focused\");\n\t\texpect(continueCurrentWork).toHaveBeenCalledTimes(1);\n\t\texpect(updatePendingMessagesDisplay).toHaveBeenCalledTimes(1);\n\t\texpect(mode.chatContainer.children.at(-1)).toMatchObject({\n\t\t\ttext: expect.stringContaining(\n\t\t\t\t\"Submitted steering for the active workstream and resumed from the latest assistant turn.\",\n\t\t\t),\n\t\t});\n\t});\n});\n"]}