mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
committed by
Jeremy Apthorp
parent
1304f259cc
commit
99e3de56df
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user