Fix getLoginItemSettings timing issue

This commit is contained in:
Ted Kim 2017-11-20 10:15:45 +09:00
parent d9481430df
commit 1660fc8d13

View file

@ -347,7 +347,7 @@ describe('app module', () => {
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})
assert.deepEqual(app.getLoginItemSettings(), {
openAtLogin: true,
@ -367,6 +367,9 @@ describe('app module', () => {
})
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(), {
openAtLogin: false,
openAsHidden: false,
@ -374,6 +377,8 @@ describe('app module', () => {
wasOpenedAsHidden: false,
restoreState: false
})
done()
}, delay);
})
it('allows you to pass a custom executable and arguments', () => {