Make sure the spec takes arguments into account.
This commit is contained in:
parent
4fce00148d
commit
852e158cc6
2 changed files with 9 additions and 9 deletions
|
@ -765,6 +765,9 @@ Returns `Boolean` - Whether the current desktop environment is Unity launcher.
|
||||||
* `args` String[] (optional) _Windows_ - The command-line arguments to compare
|
* `args` String[] (optional) _Windows_ - The command-line arguments to compare
|
||||||
against. Defaults to an empty array.
|
against. Defaults to an empty array.
|
||||||
|
|
||||||
|
If you provided arguments to `app.setLoginItemSettings` you need to pass the
|
||||||
|
same arguments here for `openAtLogin` to be set correctly.
|
||||||
|
|
||||||
Returns `Object`:
|
Returns `Object`:
|
||||||
|
|
||||||
* `openAtLogin` Boolean - `true` if the app is set to open at login.
|
* `openAtLogin` Boolean - `true` if the app is set to open at login.
|
||||||
|
|
|
@ -357,18 +357,15 @@ describe('app module', function () {
|
||||||
const updateExe = path.resolve(appFolder, '..', 'Update.exe')
|
const updateExe = path.resolve(appFolder, '..', 'Update.exe')
|
||||||
const exeName = path.basename(process.execPath)
|
const exeName = path.basename(process.execPath)
|
||||||
|
|
||||||
app.setLoginItemSettings({openAtLogin: true}, updateExe, [
|
const processStartArgs = [
|
||||||
'--processStart', `"${exeName}"`,
|
'--processStart', `"${exeName}"`,
|
||||||
'--process-start-args', `"--hidden"`
|
'--process-start-args', `"--hidden"`
|
||||||
])
|
];
|
||||||
|
|
||||||
assert.deepEqual(app.getLoginItemSettings(), {
|
app.setLoginItemSettings({openAtLogin: true}, updateExe, processStartArgs)
|
||||||
openAtLogin: true,
|
|
||||||
openAsHidden: false,
|
assert(!app.getLoginItemSettings().openAtLogin)
|
||||||
wasOpenedAtLogin: false,
|
assert(app.getLoginItemSettings(updateExe, processStartArgs))
|
||||||
wasOpenedAsHidden: false,
|
|
||||||
restoreState: false
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue