refactor(pi): simplify image reference detection

This commit is contained in:
Peter Steinberger
2026-02-26 16:52:06 +01:00
parent b678308d96
commit 1708b11fab
2 changed files with 65 additions and 65 deletions

View File

@@ -63,7 +63,6 @@ describe("detectImageReferences", () => {
expect(refs).toHaveLength(1);
expect(refs.some((r) => r.type === "path")).toBe(true);
expect(refs.some((r) => r.type === "url")).toBe(false);
});
it("handles various image extensions", () => {
@@ -83,6 +82,17 @@ describe("detectImageReferences", () => {
expect(refs).toHaveLength(1);
});
it("dedupe casing follows host filesystem conventions", () => {
const prompt = "Look at /tmp/Image.png and /tmp/image.png";
const refs = detectImageReferences(prompt);
if (process.platform === "win32") {
expect(refs).toHaveLength(1);
return;
}
expect(refs).toHaveLength(2);
});
it("returns empty array when no images found", () => {
const prompt = "Just some text without any image references";
const refs = detectImageReferences(prompt);