feat: add tray.getTitle() (#17385)

* feat: add tray.getTitle

* fix spec
This commit is contained in:
Shelley Vohr 2019-03-18 12:40:34 -07:00 committed by GitHub
parent 38d75010c7
commit 2fb9085e5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 53 additions and 14 deletions

View file

@ -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)
})
})
})