From ed3b69ffb128b383e9af41eb823d3b03f3a3dc41 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 8 Aug 2019 15:49:43 -0700 Subject: [PATCH] docs: update hasShadow for win and linux (#19675) --- docs/api/browser-window.md | 10 +++------- spec-main/api-browser-window-spec.ts | 16 +++++++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 70cc189dd609..8a069da09dbd 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1437,20 +1437,16 @@ screen readers Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user. -#### `win.setHasShadow(hasShadow)` _macOS_ +#### `win.setHasShadow(hasShadow)` * `hasShadow` Boolean -Sets whether the window should have a shadow. On Windows and Linux does -nothing. +Sets whether the window should have a shadow. -#### `win.hasShadow()` _macOS_ +#### `win.hasShadow()` Returns `Boolean` - Whether the window has a shadow. -On Windows and Linux always returns -`true`. - #### `win.setOpacity(opacity)` _Windows_ _macOS_ * `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque) diff --git a/spec-main/api-browser-window-spec.ts b/spec-main/api-browser-window-spec.ts index a80df7480845..3658fd95e753 100644 --- a/spec-main/api-browser-window-spec.ts +++ b/spec-main/api-browser-window-spec.ts @@ -3338,21 +3338,27 @@ describe('BrowserWindow module', () => { }) describe('hasShadow state', () => { - // On Windows there is no shadow by default and it can not be changed - // dynamically. + it('returns a boolean on all platforms', () => { + const w = new BrowserWindow({ show: false }) + const hasShadow = w.hasShadow() + expect(hasShadow).to.be.a('boolean') + }) + + // On Windows there's no shadow by default & it can't be changed dynamically. it('can be changed with hasShadow option', () => { const hasShadow = process.platform !== 'darwin' - const w = new BrowserWindow({ show: false, hasShadow: hasShadow }) + const w = new BrowserWindow({ show: false, hasShadow }) expect(w.hasShadow()).to.equal(hasShadow) }) - ifit(process.platform === 'darwin')('can be changed with setHasShadow method', () => { + it('can be changed with setHasShadow method', () => { const w = new BrowserWindow({ show: false }) - expect(w.hasShadow()).to.be.true('hasShadow') w.setHasShadow(false) expect(w.hasShadow()).to.be.false('hasShadow') w.setHasShadow(true) expect(w.hasShadow()).to.be.true('hasShadow') + w.setHasShadow(false) + expect(w.hasShadow()).to.be.false('hasShadow') }) }) })