spec: fix flakiness of test BrowserWindow.moveTop (#18962)
Wait for the focus event because checking focus status. BrowserWindow.show gives focus to the window but there is a moment where the window is shown but does not have the focus yet. And the test was failing at this moment.
This commit is contained in:
parent
1304f259cc
commit
99e3de56df
1 changed files with 2 additions and 0 deletions
|
@ -606,8 +606,10 @@ describe('BrowserWindow module', () => {
|
|||
|
||||
const otherWindow = new BrowserWindow({ show: false, title: 'otherWindow' })
|
||||
const otherWindowShown = emittedOnce(otherWindow, 'show')
|
||||
const otherWindowFocused = emittedOnce(otherWindow, 'focus')
|
||||
otherWindow.show()
|
||||
await otherWindowShown
|
||||
await otherWindowFocused
|
||||
expect(otherWindow.isFocused()).to.equal(true)
|
||||
|
||||
w.moveTop()
|
||||
|
|
Loading…
Reference in a new issue