fix: e2e test — copy fixture into recordings dir for path security check

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.
This commit is contained in:
Siddharth
2026-04-05 15:42:25 -07:00
parent b986148d5d
commit e45611ade4
+3 -3
View File
@@ -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);