add new and changed specs

This commit is contained in:
Shelley Vohr 2018-02-19 20:59:47 -05:00
parent 6e11a3e53d
commit 73ab87b87f
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -359,28 +359,12 @@ describe('Menu module', () => {
assert.equal(y, 101) assert.equal(y, 101)
}) })
it('works without a given BrowserWindow', () => { it('works with a given BrowserWindow, options and callback', (done) => {
const { browserWindow, x, y } = menu.popup(100, 101) const {x, y} = menu.popup(w, {x: 100, y: 101}, () => done())
assert.equal(browserWindow.constructor.name, 'BrowserWindow')
assert.equal(x, 100)
assert.equal(y, 101)
})
it('works without a given BrowserWindow and 0 options', () => {
const { browserWindow, x, y } = menu.popup(0, 1)
assert.equal(browserWindow.constructor.name, 'BrowserWindow')
assert.equal(x, 0)
assert.equal(y, 1)
})
it('works with a given BrowserWindow and no options', () => {
const { browserWindow, x, y } = menu.popup(w, 100, 101)
assert.equal(browserWindow, w)
assert.equal(x, 100) assert.equal(x, 100)
assert.equal(y, 101) assert.equal(y, 101)
menu.closePopup()
}) })
it('works with a given BrowserWindow, no options, and a callback', (done) => { it('works with a given BrowserWindow, no options, and a callback', (done) => {
@ -392,11 +376,6 @@ describe('Menu module', () => {
menu.popup({}, () => done()) menu.popup({}, () => done())
menu.closePopup() menu.closePopup()
}) })
it('works with old style', (done) => {
menu.popup(w, 100, 101, () => done())
menu.closePopup()
})
}) })
describe('Menu.setApplicationMenu', () => { describe('Menu.setApplicationMenu', () => {