Open History to see the last commit
1import { expect, it } from "vite-plus/test";
2import { filePreviewKind } from "@t3tools/shared/filePreview";
3
4it.each([
5 [
6 "report.docx",
7 "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
8 "unsupported",
9 ],
10 [
11 "budget.xlsx",
12 "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
13 "unsupported",
14 ],
15 [
16 "deck.pptx",
17 "application/vnd.openxmlformats-officedocument.presentationml.presentation",
18 "unsupported",
19 ],
20 ["report.docx", "text/plain", "text"],
21 ["report.docx", "application/octet-stream", "unsupported"],
22 ["chart.mmd", "text/vnd.mermaid", "text"],
23 ["chart.mermaid", "text/plain", "text"],
24 ["chart.mmd", "application/octet-stream", "unsupported"],
25 ["font.ttf", "font/ttf", "unsupported"],
26] as const)("preserves mobile's existing path for %s (%s)", (name, mimeType, expected) => {
27 expect(filePreviewKind({ name, mimeType }, { richDocuments: false })).toBe(expected);
28});