fix: restore original e2e test with minimal security fix additions

Revert to exact working version (7e65d52), only adding:
- recordings dir copy for path security check
- --enable-unsafe-swiftshader for CI WebGL
This commit is contained in:
Siddharth
2026-04-05 16:29:54 -07:00
parent db815e362a
commit 1b6f4cce46
+9 -11
View File
@@ -62,8 +62,7 @@ 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).
// the path security check in set-current-video-path.
const userDataDir = await app.evaluate(({ app: electronApp }) => {
return electronApp.getPath("userData");
});
@@ -72,15 +71,14 @@ test("exports a GIF from a loaded video", async () => {
fs.mkdirSync(recordingsDir, { recursive: true });
fs.copyFileSync(TEST_VIDEO, testVideoInRecordings);
try {
await hudWindow.evaluate((videoPath: string) => {
window.electronAPI.setCurrentVideoPath(videoPath);
await hudWindow.evaluate((videoPath: string) => {
window.electronAPI.setCurrentVideoPath(videoPath);
try {
window.electronAPI.switchToEditor();
}, testVideoInRecordings);
} catch {
// Expected: switchToEditor() closes the HUD window, killing the
// Playwright page context before evaluate() can resolve.
}
} catch {
// Expected: HUD window closes during this call, killing the context.
}
}, testVideoInRecordings);
// ── 3. Switch to the editor window. This closes the HUD and opens
// a new BrowserWindow with ?windowType=editor.
@@ -131,7 +129,7 @@ test("exports a GIF from a loaded video", async () => {
if (fs.existsSync(outputPath)) {
fs.unlinkSync(outputPath);
}
if (fs.existsSync(testVideoInRecordings)) {
if (testVideoInRecordings && fs.existsSync(testVideoInRecordings)) {
fs.unlinkSync(testVideoInRecordings);
}
}