spec: increase MAS timeout for login items (#15291)
This commit is contained in:
parent
f9f34fd628
commit
939ee94e67
1 changed files with 14 additions and 9 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Reference in a new issue