From 1234b61fa6d3ee3c6245c5d5dee54dfd2e8654e5 Mon Sep 17 00:00:00 2001 From: leethomas Date: Wed, 25 Jan 2017 19:39:57 -0800 Subject: [PATCH] spec to ensure an error is thrown when relativeLevel is set out of bounds --- spec/api-browser-window-spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index a07f301c8..4e13a14fc 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -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)', () => { -- 2.34.1