feat: add tray.getTitle() (#17385)
* feat: add tray.getTitle * fix spec
This commit is contained in:
parent
38d75010c7
commit
2fb9085e5b
8 changed files with 53 additions and 14 deletions
|
@ -1,4 +1,5 @@
|
|||
const { remote } = require('electron')
|
||||
const { expect } = require('chai')
|
||||
const { Menu, Tray, nativeImage } = remote
|
||||
|
||||
describe('tray module', () => {
|
||||
|
@ -35,13 +36,27 @@ describe('tray module', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('tray.setTitle', () => {
|
||||
it('accepts non-empty string', () => {
|
||||
tray.setTitle('Hello World!')
|
||||
describe('tray title get/set', () => {
|
||||
before(function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
this.skip()
|
||||
}
|
||||
})
|
||||
|
||||
it('accepts empty string', () => {
|
||||
tray.setTitle('')
|
||||
it('sets/gets non-empty title', () => {
|
||||
const title = 'Hello World!'
|
||||
tray.setTitle(title)
|
||||
const newTitle = tray.getTitle()
|
||||
|
||||
expect(newTitle).to.equal(title)
|
||||
})
|
||||
|
||||
it('sets/gets empty title', () => {
|
||||
const title = ''
|
||||
tray.setTitle(title)
|
||||
const newTitle = tray.getTitle()
|
||||
|
||||
expect(newTitle).to.equal(title)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue