SDA-3033 Add ability to close all windows from SFE-Lite

This commit is contained in:
psjostrom
2021-04-01 15:34:02 +02:00
parent c621018c22
commit 614b3beef9
9 changed files with 46 additions and 57 deletions

View File

@@ -38,6 +38,7 @@ jest.mock('../src/app/window-actions', () => {
jest.mock('../src/app/window-handler', () => {
return {
windowHandler: {
closeAllWindows: jest.fn(),
closeWindow: jest.fn(),
createNotificationSettingsWindow: jest.fn(),
createScreenPickerWindow: jest.fn(),
@@ -458,5 +459,14 @@ describe('main api handler', () => {
expect(windowHandler.appMenu.buildMenu).not.toBeCalled();
}
});
it('should call closeAllWindows on windowHandler correctly', () => {
const spy = jest.spyOn(windowHandler, 'closeAllWindows');
const value = {
cmd: apiCmds.closeAllWrapperWindows,
};
ipcMain.send(apiName.symphonyApi, value);
expect(spy).toBeCalled();
});
});
});