From d224d03e31f0387e4a8c6b79c78d1099345baaa6 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:39:59 -0500 Subject: [PATCH] fix: enable `autoHideMenuBar` tests on Linux and Windows (#46829) * fix: enable autoHideMenuBar tests Co-authored-by: Charles Kerr * docs: mark autoHideMenuBar as supported on Linux, Windows Co-authored-by: Charles Kerr --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- docs/api/base-window.md | 2 +- docs/api/browser-window.md | 2 +- docs/api/structures/base-window-options.md | 4 ++-- spec/api-browser-window-spec.ts | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/api/base-window.md b/docs/api/base-window.md index 1cf5cb18e331..35a52f8cadb2 100644 --- a/docs/api/base-window.md +++ b/docs/api/base-window.md @@ -396,7 +396,7 @@ A `View` property for the content view of the window. A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set. -#### `win.autoHideMenuBar` +#### `win.autoHideMenuBar` _Linux_ _Windows_ A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key. diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 7742039cf671..8224f3fbf563 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -497,7 +497,7 @@ A `Integer` property representing the unique ID of the window. Each ID is unique A `string` (optional) property that is equal to the `tabbingIdentifier` passed to the `BrowserWindow` constructor or `undefined` if none was set. -#### `win.autoHideMenuBar` +#### `win.autoHideMenuBar` _Linux_ _Windows_ A `boolean` property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single `Alt` key. diff --git a/docs/api/structures/base-window-options.md b/docs/api/structures/base-window-options.md index 84169a049ad9..0b451c7733a0 100644 --- a/docs/api/structures/base-window-options.md +++ b/docs/api/structures/base-window-options.md @@ -58,8 +58,8 @@ `false` on macOS. This option is not configurable on other platforms. * `disableAutoHideCursor` boolean (optional) - Whether to hide cursor when typing. Default is `false`. -* `autoHideMenuBar` boolean (optional) - Auto hide the menu bar unless the `Alt` - key is pressed. Default is `false`. +* `autoHideMenuBar` boolean (optional) _Linux_ _Windows_ - Auto hide the menu bar + unless the `Alt` key is pressed. Default is `false`. * `enableLargerThanScreen` boolean (optional) _macOS_ - Enable the window to be resized larger than screen. Only relevant for macOS, as other OSes allow larger-than-screen windows by default. Default is `false`. diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index 0a37bd50b8e9..af63690cb555 100755 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -2360,10 +2360,10 @@ describe('BrowserWindow module', () => { }); }); - describe('autoHideMenuBar state', () => { + ifdescribe(process.platform !== 'darwin')('autoHideMenuBar state', () => { afterEach(closeAllWindows); - it('for properties', () => { + describe('for properties', () => { it('can be set with autoHideMenuBar constructor option', () => { const w = new BrowserWindow({ show: false, autoHideMenuBar: true }); expect(w.autoHideMenuBar).to.be.true('autoHideMenuBar'); @@ -2379,7 +2379,7 @@ describe('BrowserWindow module', () => { }); }); - it('for functions', () => { + describe('for functions', () => { it('can be set with autoHideMenuBar constructor option', () => { const w = new BrowserWindow({ show: false, autoHideMenuBar: true }); expect(w.isMenuBarAutoHide()).to.be.true('autoHideMenuBar');