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"); }); });