From 698bff0efabbfec5d2c2d110191ba708bef34ce1 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:20:07 -0500 Subject: [PATCH] fix: enable `autoHideMenuBar` tests on Linux and Windows (#46830) * 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 d23ced860c5b..7ad17d045c90 100644 --- a/docs/api/base-window.md +++ b/docs/api/base-window.md @@ -398,7 +398,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 96ef6896ffbe..95a1baa78445 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -499,7 +499,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 56980c7683d3..c421f3cb094f 100755 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -2361,10 +2361,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'); @@ -2380,7 +2380,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');