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.
This commit is contained in:
Rafael Oleza
2019-04-09 13:18:01 +02:00
parent de31d140cb
commit dbe00f616a

View File

@@ -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)