spec to ensure an error is thrown when relativeLevel is set out of bounds
authorleethomas <leet944@gmail.com>
Thu, 26 Jan 2017 03:39:57 +0000 (19:39 -0800)
committerleethomas <leet944@gmail.com>
Thu, 26 Jan 2017 03:39:57 +0000 (19:39 -0800)
spec/api-browser-window-spec.js

index a07f301c8b379a15b9de8dfb9c9e33b70bf56950..4e13a14fca7910f9b6aa2661dac88e7bc81ba954 100644 (file)
@@ -513,6 +513,18 @@ describe('BrowserWindow module', function () {
       w.setAlwaysOnTop(true)
       assert.equal(w.isAlwaysOnTop(), true)
     })
+
+    it('raises an error when relativeLevel is out of bounds', function() {
+      if (process.platform !== 'darwin') return;
+
+      assert.throws(function() {
+        w.setAlwaysOnTop(true, '', -1)
+      })
+
+      assert.throws(function() {
+        w.setAlwaysOnTop(true, '', 2147483632)
+      })
+    })
   })
 
   describe('BrowserWindow.setAutoHideCursor(autoHide)', () => {