The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { imageMimeType, isSvgAttachment } from "./image.ts"; |
| 4 | |
| 5 | describe("isSvgAttachment", () => { |
| 6 | it("recognizes SVG previews without promoting them to provider images", () => { |
| 7 | for (const mimeType of [ |
| 8 | "image/svg+xml", |
| 9 | "IMAGE/SVG+XML; charset=utf-8", |
| 10 | "", |
| 11 | "application/octet-stream", |
| 12 | ]) { |
| 13 | const attachment = { name: "diagram.SVG", mimeType }; |
| 14 | expect(isSvgAttachment(attachment)).toBe(true); |
| 15 | expect(imageMimeType(attachment)).toBeNull(); |
| 16 | } |
| 17 | expect(isSvgAttachment({ name: "diagram.svg", mimeType: "application/pdf" })).toBe(false); |
| 18 | expect(isSvgAttachment({ name: "photo.png", mimeType: "image/png" })).toBe(false); |
| 19 | }); |
| 20 | }); |