Add specs for missing startDrag options
This commit is contained in:
parent
2ee5f6f358
commit
8ce1930f0d
2 changed files with 18 additions and 2 deletions
|
@ -285,4 +285,20 @@ describe('webContents module', function () {
|
|||
})
|
||||
w.webContents.inspectElement(10, 10)
|
||||
})
|
||||
|
||||
describe('startDrag({file, icon})', () => {
|
||||
it('throws errors for a missing file or a missing/empty icon', () => {
|
||||
assert.throws(() => {
|
||||
w.webContents.startDrag({icon: path.join(__dirname, 'fixtures', 'assets', 'logo.png')})
|
||||
}, /Must specify either 'file' or 'files' option/)
|
||||
|
||||
assert.throws(() => {
|
||||
w.webContents.startDrag({file: __filename, icon: __filename})
|
||||
}, /Must specify non-empty 'icon' option/)
|
||||
|
||||
assert.throws(() => {
|
||||
w.webContents.startDrag({file: __filename})
|
||||
}, /Must specify non-empty 'icon' option/)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue