From d6933813bdcdd841fdbe038703fb9ef7e110134e Mon Sep 17 00:00:00 2001 From: Adam <69064669+abres33@users.noreply.github.com> Date: Fri, 3 Apr 2026 02:25:29 -0500 Subject: [PATCH] fix: move try/catch outside evaluate() in gif-export E2E test --- tests/e2e/gif-export.spec.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/e2e/gif-export.spec.ts b/tests/e2e/gif-export.spec.ts index a851546..c32d604 100644 --- a/tests/e2e/gif-export.spec.ts +++ b/tests/e2e/gif-export.spec.ts @@ -58,14 +58,15 @@ test("exports a GIF from a loaded video", async () => { ); }); - await hudWindow.evaluate((videoPath: string) => { - window.electronAPI.setCurrentVideoPath(videoPath); - try { + try { + await hudWindow.evaluate((videoPath: string) => { + window.electronAPI.setCurrentVideoPath(videoPath); window.electronAPI.switchToEditor(); - } catch { - // Expected: HUD window closes during this call, killing the context. - } - }, TEST_VIDEO); + }, TEST_VIDEO); + } catch { + // Expected: switchToEditor() closes the HUD window, which terminates + // the Playwright page context before evaluate() can resolve. + } // ── 3. Switch to the editor window. This closes the HUD and opens // a new BrowserWindow with ?windowType=editor.