fix: make menu.popup options optional (#13977)
* add empty object as default param for options * update docs * add spec for optional options * fix: add null check for options
This commit is contained in:
parent
fc4499ebd4
commit
a7052efaf4
3 changed files with 9 additions and 3 deletions
|
@ -633,10 +633,16 @@ describe('Menu module', () => {
|
|||
|
||||
it('throws an error if options is not an object', () => {
|
||||
expect(() => {
|
||||
menu.popup()
|
||||
menu.popup('this is a string, not an object')
|
||||
}).to.throw(/Options must be an object/)
|
||||
})
|
||||
|
||||
it('allows for options to be optional', () => {
|
||||
expect(() => {
|
||||
menu.popup({})
|
||||
}).to.not.throw()
|
||||
})
|
||||
|
||||
it('should emit menu-will-show event', (done) => {
|
||||
menu.on('menu-will-show', () => { done() })
|
||||
menu.popup({window: w})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue