👷 Hence, better testing
This commit is contained in:
parent
22e9d665d2
commit
dfd7598d48
1 changed files with 28 additions and 3 deletions
|
@ -283,19 +283,44 @@ describe('Menu module', () => {
|
|||
})
|
||||
|
||||
it('returns immediately', () => {
|
||||
menu.popup(w, {x: 100, y: 100})
|
||||
const { browserWindow, x, y } = menu.popup(w, {x: 100, y: 100})
|
||||
|
||||
assert.equal(browserWindow, w)
|
||||
assert.equal(x, 100)
|
||||
assert.equal(y, 100)
|
||||
|
||||
menu.closePopup(w)
|
||||
})
|
||||
|
||||
it('works without a given BrowserWindow and options', () => {
|
||||
menu.popup({x: 100, y: 100})
|
||||
const { browserWindow, x, y } = menu.popup({x: 100, y: 100})
|
||||
|
||||
assert.equal(browserWindow.constructor.name, 'BrowserWindow')
|
||||
assert.equal(x, 100)
|
||||
assert.equal(y, 100)
|
||||
|
||||
menu.closePopup()
|
||||
})
|
||||
|
||||
it('works without a given BrowserWindow', () => {
|
||||
menu.popup(100, 100)
|
||||
const { browserWindow, x, y } = menu.popup(100, 100)
|
||||
|
||||
assert.equal(browserWindow.constructor.name, 'BrowserWindow')
|
||||
assert.equal(x, 100)
|
||||
assert.equal(y, 100)
|
||||
|
||||
menu.closePopup()
|
||||
})
|
||||
|
||||
it('works with a given BrowserWindow and no options', () => {
|
||||
const { browserWindow, x, y } = menu.popup(w, 100, 100)
|
||||
|
||||
assert.equal(browserWindow, w)
|
||||
assert.equal(x, 100)
|
||||
assert.equal(y, 100)
|
||||
|
||||
menu.closePopup(w)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Menu.setApplicationMenu', () => {
|
||||
|
|
Loading…
Reference in a new issue