Skip to content

Commit

Permalink
test: fixup BrowserWindow.setTitlebarOverlay test
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed May 19, 2022
1 parent 7f94317 commit 9a277f7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions spec-main/api-browser-window-spec.ts
Expand Up @@ -2187,8 +2187,10 @@ describe('BrowserWindow module', () => {
const [, newOverlayRect] = await geometryChange;
expect(newOverlayRect.width).to.equal(overlayRect.width + 400);
};
afterEach(closeAllWindows);
afterEach(() => { ipcMain.removeAllListeners('geometrychange'); });
afterEach(async () => {
await closeAllWindows();
ipcMain.removeAllListeners('geometrychange');
});
it('creates browser window with hidden title bar', () => {
const w = new BrowserWindow({
show: false,
Expand Down Expand Up @@ -2266,16 +2268,20 @@ describe('BrowserWindow module', () => {
// Confirm that maximization only affected the height of the buttons and not the title bar
expect(overlayRectPostMax.height).to.equal(size);
};
afterEach(closeAllWindows);
afterEach(() => { ipcMain.removeAllListeners('geometrychange'); });
afterEach(async () => {
await closeAllWindows();
ipcMain.removeAllListeners('geometrychange');
});
it('sets Window Control Overlay with title bar height of 40', async () => {
await testWindowsOverlayHeight(40);
});
});

ifdescribe(process.platform === 'win32')('BrowserWindow.setTitlebarOverlay', () => {
afterEach(closeAllWindows);
afterEach(() => { ipcMain.removeAllListeners('geometrychange'); });
afterEach(async () => {
await closeAllWindows();
ipcMain.removeAllListeners('geometrychange');
});

it('does not crash when an invalid titleBarStyle was initially set', () => {
const win = new BrowserWindow({
Expand Down

0 comments on commit 9a277f7

Please sign in to comment.