add specs for app.launcher api

fix linter errors
This commit is contained in:
Jonas Schwabe 2016-06-29 19:47:20 +02:00
parent 768ff7af5a
commit 9aa8807f83

View file

@ -284,4 +284,37 @@ describe('app module', function () {
})
})
})
describe('app.launcher API', function () {
it('should be available on linux', function () {
if (process.platform !== 'linux') {
assert.equal(app.launcher, undefined)
} else {
assert.notEqual(app.launcher, undefined)
}
})
it('should be possible to set a badge count on supported environments', function () {
if (process.platform === 'linux' &&
app.launcher.isCounterBadgeAvailable()) {
app.launcher.setBadgeCount(42)
assert.equal(app.launcher.getBadgeCount(), 42)
}
})
it('should be possible to set a badge count on unity', function () {
if (process.platform === 'linux' &&
app.launcher.isUnityRunning()) {
assert.equal(app.launcher.isCounterBadgeAvailable(), true)
}
})
it('should not be possible to set a badge counter on unsupported environments', function () {
if (process.platform === 'linux' &&
!app.launcher.isCounterBadgeAvailable()) {
app.launcher.setBadgeCount(42)
assert.equal(app.launcher.getBadgeCount(), 0)
}
})
})
})