Browse Source

fix: ensure that the window is focused when testing spellchecker

Samuel Attard 6 years ago
parent
commit
2420cdf027
1 changed files with 2 additions and 0 deletions
  1. 2 0
      spec/api-web-frame-spec.js

+ 2 - 0
spec/api-web-frame-spec.js

@@ -149,6 +149,8 @@ describe('webFrame module', function () {
     w = new BrowserWindow({ show: false })
     w.loadFile(path.join(fixtures, 'pages', 'webframe-spell-check.html'))
     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 misspelledWord = 'spleling'