Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

test(editor): add existing recording picker options tests

Richie McIlroye8b7d2cff5b1
diff --git a/apps/desktop/src/routes/editor/existing-recording-picker.test.ts b/apps/desktop/src/routes/editor/existing-recording-picker.test.ts
new file mode 100644
index 000000000..91e10117b
--- /dev/null
+++ b/apps/desktop/src/routes/editor/existing-recording-picker.test.ts
@@ -0,0 +1,28 @@
+import { describe, expect, it } from "vitest";
+
+import { getExistingRecordingPickerOptions } from "./existing-recording-picker";
+
+describe("existing recording picker", () => {
+ it("selects Cap project directories on Windows", () => {
+ expect(
+ getExistingRecordingPickerOptions("windows", "C:\\Cap\\recordings"),
+ ).toEqual({
+ defaultPath: "C:\\Cap\\recordings",
+ directory: true,
+ multiple: false,
+ });
+ });
+
+ it.each(["macos", "linux"] as const)(
+ "preserves the filtered file picker on %s",
+ (platform) => {
+ expect(
+ getExistingRecordingPickerOptions(platform, "/Cap/recordings"),
+ ).toEqual({
+ defaultPath: "/Cap/recordings",
+ filters: [{ name: "Cap Recording", extensions: ["cap"] }],
+ multiple: false,
+ });
+ },
+ );
+});