fix: don't crash on tray.setContextMenu(null) (#14322)
This commit is contained in:
parent
fd27d75129
commit
a08ca9defb
4 changed files with 38 additions and 6 deletions
25
spec/api-tray-spec.js
Normal file
25
spec/api-tray-spec.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const {remote} = require('electron')
|
||||
const {Menu, Tray, nativeImage} = remote
|
||||
|
||||
describe('tray module', () => {
|
||||
describe('tray.setContextMenu', () => {
|
||||
let tray
|
||||
|
||||
beforeEach(() => {
|
||||
tray = new Tray(nativeImage.createEmpty())
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
tray.destroy()
|
||||
tray = null
|
||||
})
|
||||
|
||||
it('accepts menu instance', () => {
|
||||
tray.setContextMenu(new Menu())
|
||||
})
|
||||
|
||||
it('accepts null', () => {
|
||||
tray.setContextMenu(null)
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue