This commit is contained in:
Eason Goodale
2025-04-19 22:55:37 -07:00
parent 2bcc15a839
commit 1e0a7cc313
7 changed files with 168 additions and 39 deletions

View File

@@ -13,12 +13,16 @@ vi.mock("../src/utils/input-utils.js", () => ({
}));
vi.mock("../../approvals.js", () => ({ isSafeCommand: () => null }));
vi.mock("../src/format-command.js", () => ({
formatCommandForDisplay: (c) => c.join(" "),
formatCommandForDisplay: (c: Array<string>): string => c.join(" "),
}));
import TerminalChatInput from "../src/components/chat/terminal-chat-input.js";
async function type(stdin, text, flush) {
async function type(
stdin: NodeJS.WritableStream & { write(str: string): void },
text: string,
flush: () => Promise<void>,
): Promise<void> {
stdin.write(text);
await flush();
}
@@ -67,7 +71,6 @@ describe("Backspace deletes attached image", () => {
await flush();
await type(stdin, "@", flush);
console.log('AFTER @', lastFrameStripped());
await type(stdin, "\r", flush);
const frame1 = lastFrameStripped();
expect(frame1.match(/bar\.png/g)?.length ?? 0).toBe(1);