(
sideQuestion: (input: {
workspaceId: string;
question: string;
}) => Promise<{ success: boolean; error?: string }>,
overrides: Partial<SlashCommandContext> = {}
)
| 610 | |
| 611 | describe("processSlashCommand - side-question", () => { |
| 612 | function createSideQuestionContext( |
| 613 | sideQuestion: (input: { |
| 614 | workspaceId: string; |
| 615 | question: string; |
| 616 | }) => Promise<{ success: boolean; error?: string }>, |
| 617 | overrides: Partial<SlashCommandContext> = {} |
| 618 | ): SlashCommandContext { |
| 619 | return { |
| 620 | api: { |
| 621 | workspace: { sideQuestion }, |
| 622 | } as unknown as SlashCommandContext["api"], |
| 623 | workspaceId: "side-ws", |
| 624 | variant: "workspace", |
| 625 | projectPath: "/tmp/project", |
| 626 | sendMessageOptions: { |
| 627 | model: "anthropic:claude-sonnet-4-6", |
| 628 | thinkingLevel: "off", |
| 629 | toolPolicy: [], |
| 630 | agentId: "exec", |
| 631 | }, |
| 632 | setPreferredModel: mock(() => undefined), |
| 633 | setVimEnabled: mock((cb: (prev: boolean) => boolean) => cb(false)), |
| 634 | resetInputHeight: mock(() => undefined), |
| 635 | getInput: mock(() => ""), |
| 636 | onTruncateHistory: mock(() => Promise.resolve(undefined)), |
| 637 | setInput: mock(() => undefined), |
| 638 | setToast: mock(() => undefined), |
| 639 | setAttachments: mock(() => undefined), |
| 640 | onDetachAllReviews: mock(() => undefined), |
| 641 | setSendingState: mock(() => undefined), |
| 642 | ...overrides, |
| 643 | }; |
| 644 | } |
| 645 | |
| 646 | test("clears input and launches the side question without awaiting the stream", async () => { |
| 647 | const sideQuestion = mock(() => Promise.resolve({ success: true })); |
no test coverage detected