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 => {
app.setLoginItemSettings({ openAtLogin: true })
// 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(() => {
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true,
@ -470,15 +470,20 @@ describe('app module', () => {
}, 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 })
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true,
openAsHidden: process.platform === 'darwin' && !process.mas, // Only available on macOS
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false
})
// 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({
openAtLogin: true,
openAsHidden: process.platform === 'darwin' && !process.mas, // Only available on macOS
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false
})
done()
}, delay)
})
it('correctly sets and unsets the LoginItem as hidden', function () {