Skip to content

Commit

Permalink
test: fix failing iframe test
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 2, 2021
1 parent 84aa6ca commit 4eedea6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec-main/api-browser-window-spec.ts
Expand Up @@ -3660,11 +3660,12 @@ describe('BrowserWindow module', () => {
expect(w.webContents.isLoadingMainFrame()).to.be.false('isLoadingMainFrame');

const didStartLoading = emittedOnce(w.webContents, 'did-start-loading');
w.webContents.executeJavaScript(`
await w.webContents.executeJavaScript(`(() => {
var iframe = document.createElement('iframe')
iframe.src = '${serverUrl}/page2'
document.body.appendChild(iframe)
`);
return null
})()`);
await didStartLoading;

expect(w.webContents.isLoadingMainFrame()).to.be.false('isLoadingMainFrame');
Expand Down

0 comments on commit 4eedea6

Please sign in to comment.