fix: move window buttons in-place on macOS (#30322)

This commit is contained in:
Cheng Zhao 2021-08-04 09:31:12 +09:00 committed by GitHub
parent 1c29734c91
commit 97929eab5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 334 additions and 278 deletions

View file

@ -1593,13 +1593,14 @@ describe('BrowserWindow module', () => {
expect(w._getWindowButtonVisibility()).to.equal(true);
});
it('changes window button visibility for customButtonsOnHover window', () => {
// Buttons of customButtonsOnHover are always hidden unless hovered.
it('does not change window button visibility for customButtonsOnHover window', () => {
const w = new BrowserWindow({ show: false, frame: false, titleBarStyle: 'customButtonsOnHover' });
expect(w._getWindowButtonVisibility()).to.equal(true);
w.setWindowButtonVisibility(false);
expect(w._getWindowButtonVisibility()).to.equal(false);
w.setWindowButtonVisibility(true);
expect(w._getWindowButtonVisibility()).to.equal(true);
expect(w._getWindowButtonVisibility()).to.equal(false);
w.setWindowButtonVisibility(false);
expect(w._getWindowButtonVisibility()).to.equal(false);
});
});