MM-49079 - Calls: process link clicks from Calls popout (#2558)
* process link clicks from Calls popout * add a mock for windows tests
This commit is contained in:

committed by
GitHub

parent
7127ec153a
commit
ec8e0b9cc2
@@ -80,6 +80,7 @@ jest.mock('../downloadsManager', () => ({
|
||||
}));
|
||||
|
||||
jest.mock('./callsWidgetWindow');
|
||||
jest.mock('main/views/webContentEvents', () => ({}));
|
||||
|
||||
describe('main/windows/windowManager', () => {
|
||||
describe('handleUpdateConfig', () => {
|
||||
@@ -1266,6 +1267,29 @@ describe('main/windows/windowManager', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('handleCallsLinkClick', () => {
|
||||
const windowManager = new WindowManager();
|
||||
const view1 = {
|
||||
view: {
|
||||
webContents: {
|
||||
send: jest.fn(),
|
||||
},
|
||||
},
|
||||
};
|
||||
windowManager.viewManager = {
|
||||
views: new Map([
|
||||
['server-1_tab-messaging', view1],
|
||||
]),
|
||||
getCurrentView: jest.fn(),
|
||||
};
|
||||
|
||||
it('should pass through the click link to browser history push', () => {
|
||||
windowManager.viewManager.getCurrentView.mockReturnValue(view1);
|
||||
windowManager.handleCallsLinkClick(null, {link: '/other/subpath'});
|
||||
expect(view1.view.webContents.send).toBeCalledWith('browser-history-push', '/other/subpath');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getServerURLFromWebContentsId', () => {
|
||||
const view = {
|
||||
name: 'server-1_tab-messaging',
|
||||
|
Reference in New Issue
Block a user