Files
next-ai-draw-io/tests/unit/pdf-utils.test.ts
T
dayuan.jiang 87edf2e19d fix(chat-input): stop template dialogs from sending and fix attachment races
- Template dialogs no longer submit the outer chat form
- Sending is blocked while files or URLs are still extracting
- File and URL extraction no longer drop or resurrect entries
- IME composition Enter no longer sends
- Tool call cards show the error text; keyboard handling on cards fixed
- Template import available when empty, edit dialog resets, saved templates refresh
- Only png/jpeg/gif/webp images accepted, SVG sent as text; PDF objects released
- parse-url request sends the access code
2026-10-03 17:45:41 +09:00

17 lines
539 B
TypeScript

import { describe, expect, it } from "vitest"
import { isTextFile } from "@/lib/pdf-utils"
describe("isTextFile", () => {
it("treats SVG files as text so their markup is sent to the model", () => {
const svg = new File(["<svg/>"], "diagram.svg", {
type: "image/svg+xml",
})
expect(isTextFile(svg)).toBe(true)
})
it("does not treat raster images as text", () => {
const png = new File(["x"], "photo.png", { type: "image/png" })
expect(isTextFile(png)).toBe(false)
})
})