add hide on start option (#1919)
* add hide on start option (#1918) * text update * clean up * removed `hideOnStart` from ConfigV1 & ConfigV2 * tests update
This commit is contained in:
@@ -162,11 +162,28 @@ describe('main/windows/mainWindow', () => {
|
||||
};
|
||||
BrowserWindow.mockImplementation(() => window);
|
||||
fs.readFileSync.mockImplementation(() => '{"x":400,"y":300,"width":1280,"height":700,"maximized":true,"fullscreen":false}');
|
||||
Config.hideOnStart = false;
|
||||
createMainWindow({});
|
||||
expect(window.webContents.zoomLevel).toStrictEqual(0);
|
||||
expect(window.maximize).toBeCalled();
|
||||
});
|
||||
|
||||
it('should not show window on ready-to-show', () => {
|
||||
const window = {
|
||||
...baseWindow,
|
||||
once: jest.fn().mockImplementation((event, cb) => {
|
||||
if (event === 'ready-to-show') {
|
||||
cb();
|
||||
}
|
||||
}),
|
||||
};
|
||||
BrowserWindow.mockImplementation(() => window);
|
||||
fs.readFileSync.mockImplementation(() => '{"x":400,"y":300,"width":1280,"height":700,"maximized":true,"fullscreen":false}');
|
||||
Config.hideOnStart = true;
|
||||
createMainWindow({});
|
||||
expect(window.show).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should save window state on close if the app will quit', () => {
|
||||
global.willAppQuit = true;
|
||||
const window = {
|
||||
|
Reference in New Issue
Block a user