MM-51850 - Calls: Fix for crash after closing popout (#2647)

This commit is contained in:
Christopher Poile
2023-03-31 11:46:27 -04:00
committed by GitHub
parent a6f153b55a
commit 4fe66b298d
2 changed files with 25 additions and 1 deletions

View File

@@ -531,6 +531,23 @@ describe('main/windows/callsWidgetWindow', () => {
expect(popOut.webContents.on).toHaveBeenCalledWith('will-redirect', widgetWindow.onWillRedirect);
});
it('onPopOutClosed', () => {
const widgetWindow = new CallsWidgetWindow(mainWindow, mainView, widgetConfig);
expect(widgetWindow.popOut).toBeNull();
const popOut = new EventEmitter();
popOut.webContents = {
on: jest.fn(),
id: 'webContentsId',
};
widgetWindow.onPopOutCreate(popOut);
expect(widgetWindow.popOut).toBe(popOut);
popOut.emit('closed');
expect(widgetWindow.popOut).toBeNull();
});
it('getWebContentsId', () => {
baseWindow.webContents = {
...baseWindow.webContents,