spec: increase MAS timeout for login items (#15291)

This commit is contained in:
Shelley Vohr 2018-10-19 13:11:11 -07:00 committed by GitHub
parent f9f34fd628
commit 939ee94e67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -457,7 +457,7 @@ describe('app module', () => {
it('sets and returns the app as a login item', done => { it('sets and returns the app as a login item', done => {
app.setLoginItemSettings({ openAtLogin: true }) app.setLoginItemSettings({ openAtLogin: true })
// Wait because login item settings are not applied immediately in MAS build // Wait because login item settings are not applied immediately in MAS build
const delay = process.mas ? 150 : 0 const delay = process.mas ? 250 : 0
setTimeout(() => { setTimeout(() => {
expect(app.getLoginItemSettings()).to.deep.equal({ expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true, openAtLogin: true,
@ -470,8 +470,11 @@ describe('app module', () => {
}, delay) }, delay)
}) })
it('adds a login item that loads in hidden mode', () => { it('adds a login item that loads in hidden mode', done => {
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true }) app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true })
// Wait because login item settings are not applied immediately in MAS build
const delay = process.mas ? 250 : 0
setTimeout(() => {
expect(app.getLoginItemSettings()).to.deep.equal({ expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true, openAtLogin: true,
openAsHidden: process.platform === 'darwin' && !process.mas, // Only available on macOS openAsHidden: process.platform === 'darwin' && !process.mas, // Only available on macOS
@ -479,6 +482,8 @@ describe('app module', () => {
wasOpenedAsHidden: false, wasOpenedAsHidden: false,
restoreState: false restoreState: false
}) })
done()
}, delay)
}) })
it('correctly sets and unsets the LoginItem as hidden', function () { it('correctly sets and unsets the LoginItem as hidden', function () {