Fix media permissions failure on Calls window (#2550)

This commit is contained in:
Claudio Costa
2023-02-10 11:13:31 -06:00
committed by GitHub
parent 8dbdb0a75e
commit 562ef14aef
4 changed files with 65 additions and 0 deletions

View File

@@ -1183,4 +1183,35 @@ describe('main/windows/windowManager', () => {
expect(windowManager.switchServer).toHaveBeenCalledWith('server-2');
});
});
describe('getServerURLFromWebContentsId', () => {
const view = {
name: 'server-1_tab-messaging',
serverInfo: {
remoteInfo: {
siteURL: 'http://server-1.com',
},
},
};
const windowManager = new WindowManager();
windowManager.viewManager = {
views: new Map([
['server-1_tab-messaging', view],
]),
findViewByWebContent: jest.fn(),
};
it('should return calls widget URL', () => {
CallsWidgetWindow.mockImplementation(() => {
return {
on: jest.fn(),
getURL: jest.fn(() => 'http://localhost:8065'),
getWebContentsId: jest.fn(() => 'callsID'),
};
});
windowManager.createCallsWidgetWindow(null, 'server-1_tab-messaging', {callID: 'test'});
expect(windowManager.getServerURLFromWebContentsId('callsID')).toBe(windowManager.callsWidgetWindow.getURL());
});
});
});