fix: natively implement LoginItem functions (#15010)

This commit is contained in:
Shelley Vohr 2018-10-12 15:19:27 -07:00 committed by Jeremy Apthorp
parent e61b88fc2a
commit 6fc2a2a051
3 changed files with 84 additions and 12 deletions

View file

@ -466,6 +466,21 @@ describe('app module', () => {
}, delay)
})
it('correctly sets and unsets the LoginItem as hidden', function () {
if (process.platform !== 'darwin' || process.mas) this.skip()
expect(app.getLoginItemSettings().openAtLogin).to.be.false()
expect(app.getLoginItemSettings().openAsHidden).to.be.false()
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true })
expect(app.getLoginItemSettings().openAtLogin).to.be.true()
expect(app.getLoginItemSettings().openAsHidden).to.be.true()
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: false })
expect(app.getLoginItemSettings().openAtLogin).to.be.true()
expect(app.getLoginItemSettings().openAsHidden).to.be.false()
})
it('allows you to pass a custom executable and arguments', function () {
if (process.platform !== 'win32') {
// FIXME(alexeykuzmin): Skip the test.