spec: Compare id instead of the object

Otherwise it is impossible to see what's wrong.
This commit is contained in:
Cheng Zhao 2017-08-29 15:45:16 +09:00
parent f0f17fffd8
commit 7f4b74f8c6

View file

@ -1210,10 +1210,10 @@ describe('BrowserWindow module', function () {
sandbox: true
}
})
const initialWebContents = webContents.getAllWebContents()
const initialWebContents = webContents.getAllWebContents().map((i) => i.id)
ipcRenderer.send('prevent-next-new-window', w.webContents.id)
w.webContents.once('new-window', () => {
assert.deepEqual(webContents.getAllWebContents(), initialWebContents)
assert.deepEqual(webContents.getAllWebContents().map((i) => i.id), initialWebContents)
done()
})
w.loadURL('file://' + path.join(fixtures, 'pages', 'window-open.html'))