Open History to see the last commit
1import { FolderClosedIcon } from "lucide-react";
2import { describe, expect, it } from "vite-plus/test";
3
4import { FileExplorerIcon, FinderIcon } from "../Icons";
5import { resolveOpenInOptions } from "./OpenInPicker";
6
7describe("resolveOpenInOptions", () => {
8 it.each([
9 ["MacIntel", "Finder", FinderIcon],
10 ["Win32", "File Explorer", FileExplorerIcon],
11 ["Linux x86_64", "Files", FolderClosedIcon],
12 ] as const)("includes the file manager with its icon on %s", (platform, label, Icon) => {
13 expect(resolveOpenInOptions(platform, ["cursor", "vscode", "file-manager"])).toEqual([
14 expect.objectContaining({ value: "cursor", label: "Cursor" }),
15 expect.objectContaining({ value: "vscode", label: "VS Code" }),
16 expect.objectContaining({ value: "file-manager", label, Icon }),
17 ]);
18 });
19
20 it("omits the file manager when unavailable or using remote editors", () => {
21 expect(resolveOpenInOptions("MacIntel", ["vscode"])).toEqual([
22 expect.objectContaining({ value: "vscode" }),
23 ]);
24 expect(resolveOpenInOptions("MacIntel", [])).toEqual([]);
25 });
26});