Make sure the spec takes arguments into account.
authorCharlieHess <ifightnoman@gmail.com>
Thu, 26 Jan 2017 20:35:46 +0000 (12:35 -0800)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 6 Feb 2017 16:34:35 +0000 (08:34 -0800)
docs/api/app.md
spec/api-app-spec.js

index 657cf0255fbb6ab84276e2e39559f6cfbb8f340c..f88bc4c64759757440777ce51d8965ed26b25ab9 100644 (file)
@@ -765,6 +765,9 @@ Returns `Boolean` - Whether the current desktop environment is Unity launcher.
 * `args` String[] (optional) _Windows_ - The command-line arguments to compare
   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`:
 
 * `openAtLogin` Boolean - `true` if the app is set to open at login.
index 0d8c3a37ff12d3e4d03644774c7ddf18c5b84e65..5ad2a69481ee2050452e8bd201bba9116e2e9cf9 100644 (file)
@@ -357,18 +357,15 @@ describe('app module', function () {
       const updateExe = path.resolve(appFolder, '..', 'Update.exe')
       const exeName = path.basename(process.execPath)
 
-      app.setLoginItemSettings({openAtLogin: true}, updateExe, [
+      const processStartArgs = [
         '--processStart', `"${exeName}"`,
         '--process-start-args', `"--hidden"`
-      ])
+      ];
 
-      assert.deepEqual(app.getLoginItemSettings(), {
-        openAtLogin: true,
-        openAsHidden: false,
-        wasOpenedAtLogin: false,
-        wasOpenedAsHidden: false,
-        restoreState: false
-      })
+      app.setLoginItemSettings({openAtLogin: true}, updateExe, processStartArgs)
+
+      assert(!app.getLoginItemSettings().openAtLogin)
+      assert(app.getLoginItemSettings(updateExe, processStartArgs))
     })
   })