From 2406c82ef53b9cbd807519a4fbb37a9c2c35b24f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 6 Jul 2016 13:34:14 -0700 Subject: [PATCH] Add specs for login item APIs --- spec/api-app-spec.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js index 111d387d3404..fdb71548401d 100644 --- a/spec/api-app-spec.js +++ b/spec/api-app-spec.js @@ -298,4 +298,33 @@ describe('app module', function () { assert.equal(app.getBadgeCount(), shouldFail ? 0 : 42) }) }) + + describe('app.getLoginItemStatus API', function () { + if (process.platform !== 'darwin') return + + afterEach(function () { + app.removeAsLoginItem() + assert.equal(app.getLoginItemStatus().loginItem, false) + }) + + it('returns the login item status of the app', function () { + app.setAsLoginItem(true) + assert.equal(app.getLoginItemStatus().loginItem, true) + assert.equal(app.getLoginItemStatus().hidden, true) + + app.setAsLoginItem(false) + assert.equal(app.getLoginItemStatus().loginItem, true) + assert.equal(app.getLoginItemStatus().hidden, false) + }) + }) + + describe('app.getLoginItemLaunchStatus API', function () { + if (process.platform !== 'darwin') return + + it('returns the login item status launch of the app', function () { + assert.equal(app.getLoginItemLaunchStatus().loginItem, false) + assert.equal(app.getLoginItemLaunchStatus().hidden, false) + assert.equal(app.getLoginItemLaunchStatus().restoreState, false) + }) + }) })