Fix getLoginItemSettings timing issue
This commit is contained in:
parent
d9481430df
commit
1660fc8d13
1 changed files with 13 additions and 8 deletions
|
@ -347,7 +347,7 @@ describe('app module', () => {
|
||||||
app.setLoginItemSettings({openAtLogin: false, path: updateExe, args: processStartArgs})
|
app.setLoginItemSettings({openAtLogin: false, path: updateExe, args: processStartArgs})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns the login item status of the app', () => {
|
it('returns the login item status of the app', (done) => {
|
||||||
app.setLoginItemSettings({openAtLogin: true})
|
app.setLoginItemSettings({openAtLogin: true})
|
||||||
assert.deepEqual(app.getLoginItemSettings(), {
|
assert.deepEqual(app.getLoginItemSettings(), {
|
||||||
openAtLogin: true,
|
openAtLogin: true,
|
||||||
|
@ -367,6 +367,9 @@ describe('app module', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
app.setLoginItemSettings({})
|
app.setLoginItemSettings({})
|
||||||
|
// Wait because login item settings are not applied immediately in MAS build
|
||||||
|
const delay = process.mas ? 100 : 0;
|
||||||
|
setTimeout(() => {
|
||||||
assert.deepEqual(app.getLoginItemSettings(), {
|
assert.deepEqual(app.getLoginItemSettings(), {
|
||||||
openAtLogin: false,
|
openAtLogin: false,
|
||||||
openAsHidden: false,
|
openAsHidden: false,
|
||||||
|
@ -374,6 +377,8 @@ describe('app module', () => {
|
||||||
wasOpenedAsHidden: false,
|
wasOpenedAsHidden: false,
|
||||||
restoreState: false
|
restoreState: false
|
||||||
})
|
})
|
||||||
|
done()
|
||||||
|
}, delay);
|
||||||
})
|
})
|
||||||
|
|
||||||
it('allows you to pass a custom executable and arguments', () => {
|
it('allows you to pass a custom executable and arguments', () => {
|
||||||
|
|
Loading…
Reference in a new issue