From dbe00f616abfa3dc2d0195cd5988fae42fae3a85 Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Tue, 9 Apr 2019 13:18:01 +0200 Subject: [PATCH] Fix atom-application tests When closing a window with a file that does not exist, Atom opens a dialog asking the users if they want to save the changes. This dialog prevented the tests from finishing correctly. --- spec/main-process/atom-application.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/main-process/atom-application.test.js b/spec/main-process/atom-application.test.js index 88603c17c..30f8ca69f 100644 --- a/spec/main-process/atom-application.test.js +++ b/spec/main-process/atom-application.test.js @@ -663,6 +663,10 @@ describe('AtomApplication', function () { parseCommandLine([path.join(makeTempDir('a'), 'file-a')]) ) await focusWindow(window) + + // Choosing "Don't save" + mockElectronShowMessageBox({ response: 2 }) + window.close() await window.closedPromise await atomApplication.lastBeforeQuitPromise @@ -675,6 +679,10 @@ describe('AtomApplication', function () { parseCommandLine([path.join(makeTempDir('a'), 'file-a')]) ) await focusWindow(window) + + // Choosing "Don't save" + mockElectronShowMessageBox({ response: 2 }) + window.close() await window.closedPromise await timeoutPromise(1000)