Download apps/web/src/lib/reviewFileName.test.ts from aliroya/contiai: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/spaces/aliroya/contiai/resolve/main/apps/web/src/lib/reviewFileName.test.ts
- Command line
-
hf download hf://spaces/aliroya/contiai/apps/web/src/lib/reviewFileName.test.ts
-
curl -L -o reviewFileName.test.ts https://huggingface.co/spaces/aliroya/contiai/resolve/main/apps/web/src/lib/reviewFileName.test.ts
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"); | |
| }); | |
| }); | |