linted and working

This commit is contained in:
Eason Goodale
2025-04-20 01:26:40 -07:00
parent 1e0a7cc313
commit b1cef74d8c
12 changed files with 121 additions and 65 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ describe("Chat input attachment preview", () => {
process.chdir(TMP);
const { stdin, flush, lastFrameStripped, cleanup } = renderTui(
React.createElement(TerminalChatInput, props())
React.createElement(TerminalChatInput, props()),
);
await flush();
@@ -65,7 +65,7 @@ describe("Backspace deletes attached image", () => {
process.chdir(TMP);
const { stdin, flush, lastFrameStripped, cleanup } = renderTui(
React.createElement(TerminalChatInput, props())
React.createElement(TerminalChatInput, props()),
);
await flush();
+2 -2
View File
@@ -47,7 +47,7 @@ describe("Image picker overlay", () => {
onPick: () => {},
onCancel: () => {},
onChangeDir,
})
}),
);
await flush();
@@ -65,7 +65,7 @@ describe("Image picker overlay", () => {
onPick,
onCancel: () => {},
onChangeDir: () => {},
})
}),
);
await flush();
await type(stdin, "\r", flush);
+7 -5
View File
@@ -5,7 +5,10 @@ import { renderTui } from "./ui-test-helpers.js";
import TerminalInlineImage from "../src/components/chat/terminal-inline-image.js";
import TerminalChatResponseItem from "../src/components/chat/terminal-chat-response-item.js";
import { imageFilenameByDataUrl, createInputItem } from "../src/utils/input-utils.js";
import {
imageFilenameByDataUrl,
createInputItem,
} from "../src/utils/input-utils.js";
// ---------------------------------------------------------------------------
// Helpers
@@ -14,11 +17,10 @@ import { imageFilenameByDataUrl, createInputItem } from "../src/utils/input-util
import path from "node:path";
import fs from "node:fs";
describe("TerminalInlineImage fallback", () => {
it("renders alt text in test env", () => {
const { lastFrameStripped } = renderTui(
<TerminalInlineImage src={Buffer.from("abc")} alt="placeholder" />
<TerminalInlineImage src={Buffer.from("abc")} alt="placeholder" />,
);
expect(lastFrameStripped()).toContain("placeholder");
});
@@ -42,9 +44,9 @@ describe("TerminalChatResponseItem image label", () => {
it("shows filename", () => {
const msg = fakeImageMessage("sample.png");
const { lastFrameStripped } = renderTui(
<TerminalChatResponseItem item={msg as any} />
<TerminalChatResponseItem item={msg as any} />,
);
expect(lastFrameStripped()).toContain("sample.png");
expect(lastFrameStripped()).toContain('<Image path="sample.png">');
});
});