fix: allow Tray with title only (without icon) on Mac (#14384)
This commit is contained in:
parent
0aec308681
commit
a341ae450a
2 changed files with 40 additions and 20 deletions
|
@ -2,18 +2,18 @@ const {remote} = require('electron')
|
|||
const {Menu, Tray, nativeImage} = remote
|
||||
|
||||
describe('tray module', () => {
|
||||
let tray
|
||||
|
||||
beforeEach(() => {
|
||||
tray = new Tray(nativeImage.createEmpty())
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
tray.destroy()
|
||||
tray = null
|
||||
})
|
||||
|
||||
describe('tray.setContextMenu', () => {
|
||||
let tray
|
||||
|
||||
beforeEach(() => {
|
||||
tray = new Tray(nativeImage.createEmpty())
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
tray.destroy()
|
||||
tray = null
|
||||
})
|
||||
|
||||
it('accepts menu instance', () => {
|
||||
tray.setContextMenu(new Menu())
|
||||
})
|
||||
|
@ -22,4 +22,26 @@ describe('tray module', () => {
|
|||
tray.setContextMenu(null)
|
||||
})
|
||||
})
|
||||
|
||||
describe('tray.setImage', () => {
|
||||
it('accepts empty image', () => {
|
||||
tray.setImage(nativeImage.createEmpty())
|
||||
})
|
||||
})
|
||||
|
||||
describe('tray.setPressedImage', () => {
|
||||
it('accepts empty image', () => {
|
||||
tray.setPressedImage(nativeImage.createEmpty())
|
||||
})
|
||||
})
|
||||
|
||||
describe('tray.setTitle', () => {
|
||||
it('accepts non-empty string', () => {
|
||||
tray.setTitle('Hello World!')
|
||||
})
|
||||
|
||||
it('accepts empty string', () => {
|
||||
tray.setTitle('')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue