contiai / apps /web /src /lib /reviewFileName.test.ts
aliabozahra315's picture
Deploy be8b84f
968115e
Raw History Blame Contribute Delete
699 Bytes
import { describe, expect, it } from "vitest";
import { reviewFileName } from "./api";
describe("the gate's Word file name", () => {
it("takes the server's name, after the book", () => {
const header = `attachment; filename="blueprint-1.docx"; filename*=UTF-8''${encodeURIComponent(
"التصور الفني - صناعة المعنى.docx",
)}`;
expect(reviewFileName(header)).toBe("التصور الفني - صناعة المعنى.docx");
});
it("falls back to a plain name", () => {
expect(reviewFileName(null)).toBe("التصور الفني.docx");
expect(reviewFileName("attachment; filename*=UTF-8''%E0%A4%A")).toBe("التصور الفني.docx");
});
});