Skip to content

Commit

Permalink
spec: fix type errors in devToolsWebContents (#23187)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Apr 20, 2020
1 parent b17cb62 commit ba39281
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec-main/api-web-contents-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ describe('webContents module', () => {
const devToolsOpened = emittedOnce(w.webContents, 'devtools-opened');
w.webContents.openDevTools();
await devToolsOpened;
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.devToolsWebContents.id);
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.devToolsWebContents!.id);
const devToolsClosed = emittedOnce(w.webContents, 'devtools-closed');
w.webContents.closeDevTools();
await devToolsClosed;
Expand Down Expand Up @@ -468,7 +468,7 @@ describe('webContents module', () => {
const w = new BrowserWindow({ show: false });
w.webContents.openDevTools();
w.webContents.once('devtools-opened', () => {
expect(w.webContents.devToolsWebContents.getWebPreferences()).to.be.null();
expect(w.webContents.devToolsWebContents!.getWebPreferences()).to.be.null();
done();
});
});
Expand Down Expand Up @@ -1656,11 +1656,11 @@ describe('webContents module', () => {
const opened = emittedOnce(w.webContents, 'devtools-opened');
w.webContents.openDevTools();
await opened;
await emittedOnce(w.webContents.devToolsWebContents, 'did-finish-load');
w.webContents.devToolsWebContents.focus();
await emittedOnce(w.webContents.devToolsWebContents!, 'did-finish-load');
w.webContents.devToolsWebContents!.focus();

// Focus an input field
await w.webContents.devToolsWebContents.executeJavaScript(`
await w.webContents.devToolsWebContents!.executeJavaScript(`
const input = document.createElement('input')
document.body.innerHTML = ''
document.body.appendChild(input)
Expand All @@ -1670,7 +1670,7 @@ describe('webContents module', () => {
// Write something to the clipboard
clipboard.writeText('test value');

const pasted = w.webContents.devToolsWebContents.executeJavaScript(`new Promise(resolve => {
const pasted = w.webContents.devToolsWebContents!.executeJavaScript(`new Promise(resolve => {
document.querySelector('input').addEventListener('paste', (e) => {
resolve(e.target.value)
})
Expand Down

0 comments on commit ba39281

Please sign in to comment.