add first pass at menu event specs

This commit is contained in:
Shelley Vohr 2018-01-27 11:23:46 -05:00
parent bef4c84799
commit e345342e36
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -284,6 +284,17 @@ describe('Menu module', () => {
return closeWindow(w).then(() => { w = null }) return closeWindow(w).then(() => { w = null })
}) })
it('should emit menu-will-show event', (done) => {
menu.popup(w)
menu.on('menu-will-show', () => { done() })
})
it('should emit menu-will-close event', (done) => {
menu.popup(w)
menu.closePopup()
menu.on('menu-will-close', () => { done() })
})
it('returns immediately', () => { it('returns immediately', () => {
const { browserWindow, x, y } = menu.popup(w, {x: 100, y: 101}) const { browserWindow, x, y } = menu.popup(w, {x: 100, y: 101})