fix: catch expected page close error in e2e test evaluate call

switchToEditor closes the HUD window, which terminates the Playwright
page context before evaluate can return. Catch at the outer level.
This commit is contained in:
Siddharth
2026-04-05 16:20:29 -07:00
parent dc0856282f
commit ed9b8689f7
+8 -7
View File
@@ -72,14 +72,15 @@ test("exports a GIF from a loaded video", async () => {
fs.mkdirSync(recordingsDir, { recursive: true });
fs.copyFileSync(TEST_VIDEO, testVideoInRecordings);
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.
}
}, testVideoInRecordings);
}, testVideoInRecordings);
} catch {
// Expected: switchToEditor() closes the HUD window, killing 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.