Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveUploadMimeType } from "./uploadFileClient";
|
||||
|
||||
describe("resolveUploadMimeType", () => {
|
||||
it("keeps what the browser reports", () => {
|
||||
expect(resolveUploadMimeType({ name: "angebot.pdf", type: "application/pdf" })).toBe("application/pdf");
|
||||
});
|
||||
|
||||
it("falls back to the extension when the browser reports nothing", () => {
|
||||
// macOS has no system type for .md, so Chrome hands over an empty string —
|
||||
// declaring octet-stream there got a file the store allows rejected.
|
||||
expect(resolveUploadMimeType({ name: "notiz.md", type: "" })).toBe("text/markdown");
|
||||
expect(resolveUploadMimeType({ name: "Notiz.MARKDOWN", type: "" })).toBe("text/markdown");
|
||||
expect(resolveUploadMimeType({ name: "liste.csv", type: "" })).toBe("text/csv");
|
||||
});
|
||||
|
||||
it("stays at octet-stream for anything the store would not take anyway", () => {
|
||||
expect(resolveUploadMimeType({ name: "tool.exe", type: "" })).toBe("application/octet-stream");
|
||||
expect(resolveUploadMimeType({ name: "ohne-endung", type: "" })).toBe("application/octet-stream");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user