fix: ensure that the window is focused when testing spellchecker

This commit is contained in:
Samuel Attard 2018-10-10 14:02:46 +11:00
parent 2b8ef344b7
commit 2420cdf027

View file

@ -149,6 +149,8 @@ describe('webFrame module', function () {
w = new BrowserWindow({ show: false }) w = new BrowserWindow({ show: false })
w.loadFile(path.join(fixtures, 'pages', 'webframe-spell-check.html')) w.loadFile(path.join(fixtures, 'pages', 'webframe-spell-check.html'))
await emittedOnce(w.webContents, 'did-finish-load') await emittedOnce(w.webContents, 'did-finish-load')
w.focus()
await w.webContents.executeJavaScript('document.querySelector("input").focus()', true)
const spellCheckerFeedback = emittedOnce(ipcMain, 'spec-spell-check') const spellCheckerFeedback = emittedOnce(ipcMain, 'spec-spell-check')
const misspelledWord = 'spleling' const misspelledWord = 'spleling'