mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
19 lines
571 B
TypeScript
19 lines
571 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveFilePreviewKind } from "../../src/frontend/file-preview-preload";
|
|
|
|
describe("resolveFilePreviewKind", () => {
|
|
it.each([
|
|
["photo.webp", "image"],
|
|
["movie.webm", "video"],
|
|
["voice.m4a", "audio"],
|
|
["README.md", "markdown"],
|
|
["manual.pdf", "pdf"],
|
|
["notes.txt", "text"],
|
|
["app.tsx", "code"],
|
|
["Dockerfile", "code"],
|
|
["LICENSE", "unknown"],
|
|
] as const)("classifies %s as %s", (filename, expected) => {
|
|
expect(resolveFilePreviewKind(filename)).toBe(expected);
|
|
});
|
|
});
|