From e45611ade4174bf21e034f2ad611c82ec0d122db Mon Sep 17 00:00:00 2001 From: Siddharth Date: Sun, 5 Apr 2026 15:42:25 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20e2e=20test=20=E2=80=94=20copy=20fixture?= =?UTF-8?q?=20into=20recordings=20dir=20for=20path=20security=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test fixture path is outside RECORDINGS_DIR, so set-current-video-path rejects it after the path traversal fix. Copy the fixture into the app recordings directory before loading it. --- tests/e2e/gif-export.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/gif-export.spec.ts b/tests/e2e/gif-export.spec.ts index 645cf42..a60fff2 100644 --- a/tests/e2e/gif-export.spec.ts +++ b/tests/e2e/gif-export.spec.ts @@ -62,10 +62,10 @@ test("exports a GIF from a loaded video", async () => { // Copy the test fixture into the app's recordings directory so it passes // the path security check in set-current-video-path (which only allows // paths inside RECORDINGS_DIR or explicitly user-approved paths). - const recordingsDir = await app.evaluate(({ app: electronApp }) => { - const path = require("node:path"); - return path.join(electronApp.getPath("userData"), "recordings"); + const userDataDir = await app.evaluate(({ app: electronApp }) => { + return electronApp.getPath("userData"); }); + const recordingsDir = path.join(userDataDir, "recordings"); testVideoInRecordings = path.join(recordingsDir, "test-sample.webm"); fs.mkdirSync(recordingsDir, { recursive: true }); fs.copyFileSync(TEST_VIDEO, testVideoInRecordings);