Added tests for BrowserWindow.setAppDetails

This commit is contained in:
Tereza Tomcova 2016-11-18 21:28:24 +01:00
parent 38b14fc912
commit 782417b1fa

View file

@ -518,6 +518,34 @@ describe('browser-window module', function () {
})
})
describe('BrowserWindow.setAppDetails(options)', function () {
if (process.platform !== 'win32') return
it('supports setting the app details', function () {
const iconPath = path.join(fixtures, 'assets', 'icon.ico')
assert.doesNotThrow(function () {
w.setAppDetails({appId: 'my.app.id'})
w.setAppDetails({appIconPath: iconPath, appIconIndex: 0})
w.setAppDetails({appIconPath: iconPath})
w.setAppDetails({relaunchCommand: 'my-app.exe arg1 arg2', relaunchDisplayName: 'My app name'})
w.setAppDetails({relaunchCommand: 'my-app.exe arg1 arg2'})
w.setAppDetails({relaunchDisplayName: 'My app name'})
w.setAppDetails({
appId: 'my.app.id',
appIconPath: iconPath,
appIconIndex: 0,
relaunchCommand: 'my-app.exe arg1 arg2',
relaunchDisplayName: 'My app name'
})
w.setAppDetails({})
})
assert.throws(function () {
w.setAppDetails()
}, /Insufficient number of arguments./)
})
})
describe('BrowserWindow.fromId(id)', function () {
it('returns the window with id', function () {
assert.equal(w.id, BrowserWindow.fromId(w.id).id)