From 73ab87b87f6c002c7e10db2d4006f6327473fad3 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 19 Feb 2018 20:59:47 -0500 Subject: [PATCH] add new and changed specs --- spec/api-menu-spec.js | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/spec/api-menu-spec.js b/spec/api-menu-spec.js index 985f00bcf666..953253cb0b41 100644 --- a/spec/api-menu-spec.js +++ b/spec/api-menu-spec.js @@ -359,28 +359,12 @@ describe('Menu module', () => { assert.equal(y, 101) }) - it('works without a given BrowserWindow', () => { - const { browserWindow, x, y } = menu.popup(100, 101) + it('works with a given BrowserWindow, options and callback', (done) => { + const {x, y} = menu.popup(w, {x: 100, y: 101}, () => done()) - assert.equal(browserWindow.constructor.name, 'BrowserWindow') - assert.equal(x, 100) - assert.equal(y, 101) - }) - - it('works without a given BrowserWindow and 0 options', () => { - const { browserWindow, x, y } = menu.popup(0, 1) - - assert.equal(browserWindow.constructor.name, 'BrowserWindow') - assert.equal(x, 0) - assert.equal(y, 1) - }) - - it('works with a given BrowserWindow and no options', () => { - const { browserWindow, x, y } = menu.popup(w, 100, 101) - - assert.equal(browserWindow, w) assert.equal(x, 100) assert.equal(y, 101) + menu.closePopup() }) it('works with a given BrowserWindow, no options, and a callback', (done) => { @@ -392,11 +376,6 @@ describe('Menu module', () => { menu.popup({}, () => done()) menu.closePopup() }) - - it('works with old style', (done) => { - menu.popup(w, 100, 101, () => done()) - menu.closePopup() - }) }) describe('Menu.setApplicationMenu', () => {