From afee4a78f2b91fdf66fc316079fab8dda49d8199 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 11:21:05 -0400 Subject: [PATCH] fix: run `visibleOnAllWorkspaces` tests on the right platforms (#46833) * test: add platform test on visibleOnAllWorkspaces tests visibleOnAllWorkspaces is not supported on Windows Co-authored-by: Charles Kerr * test: do not skip visibleOnAllWorkspaces tests on Windows That feature is supported on Linux, so move the test from the "window states (excluding Linux)" section into the "window states" section. Co-authored-by: Charles Kerr * fix: nested it() calls in visibleOnAllWorkspaces specs Co-authored-by: Charles Kerr * chore: make the process.platform test simpler Co-authored-by: Charles Kerr * chore: disable visibleOnAllWorkspaces test on Linux --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- spec/api-browser-window-spec.ts | 41 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index af63690cb555..0ef1faee1a27 100755 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -5406,6 +5406,27 @@ describe('BrowserWindow module', () => { expect(w.webContents.isLoadingMainFrame()).to.be.true('isLoadingMainFrame'); }); }); + + // FIXME: enable this test on Linux as well. + ifdescribe(process.platform === 'darwin')('visibleOnAllWorkspaces state', () => { + describe('with properties', () => { + it('can be changed', () => { + const w = new BrowserWindow({ show: false }); + expect(w.visibleOnAllWorkspaces).to.be.false(); + w.visibleOnAllWorkspaces = true; + expect(w.visibleOnAllWorkspaces).to.be.true(); + }); + }); + + describe('with functions', () => { + it('can be changed', () => { + const w = new BrowserWindow({ show: false }); + expect(w.isVisibleOnAllWorkspaces()).to.be.false(); + w.setVisibleOnAllWorkspaces(true); + expect(w.isVisibleOnAllWorkspaces()).to.be.true(); + }); + }); + }); }); ifdescribe(process.platform !== 'linux')('window states (excluding Linux)', () => { @@ -5446,26 +5467,6 @@ describe('BrowserWindow module', () => { }); }); - describe('visibleOnAllWorkspaces state', () => { - it('with properties', () => { - it('can be changed', () => { - const w = new BrowserWindow({ show: false }); - expect(w.visibleOnAllWorkspaces).to.be.false(); - w.visibleOnAllWorkspaces = true; - expect(w.visibleOnAllWorkspaces).to.be.true(); - }); - }); - - it('with functions', () => { - it('can be changed', () => { - const w = new BrowserWindow({ show: false }); - expect(w.isVisibleOnAllWorkspaces()).to.be.false(); - w.setVisibleOnAllWorkspaces(true); - expect(w.isVisibleOnAllWorkspaces()).to.be.true(); - }); - }); - }); - ifdescribe(process.platform === 'darwin')('documentEdited state', () => { it('with properties', () => { it('can be changed', () => {