Add spec for quitAndInstall with no update on Windows
authorKevin Sawicki <kevinsawicki@gmail.com>
Mon, 8 Aug 2016 20:12:39 +0000 (13:12 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 8 Aug 2016 20:13:08 +0000 (13:13 -0700)
spec/api-auto-updater-spec.js

index f93590c..0716c22 100644 (file)
@@ -50,5 +50,19 @@ if (!process.mas) {
         done()
       })
     })
+
+    describe('quitAndInstall', function () {
+      it('emits an error on Windows when no update is available', function (done) {
+        if (process.platform !== 'win32') {
+          return done()
+        }
+
+        ipcRenderer.once('auto-updater-error', function (event, message) {
+          assert.equal(message, 'No update available, can\'t quit and install')
+          done()
+        })
+        autoUpdater.quitAndInstall()
+      })
+    })
   })
 }