Repository: manusa/electronim
Pull request #307 (2023-06-03 15:15:22)

⬆ Bump electron to 25.0.1

sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=manusa_electronim&pullRequest=307)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=manusa_electronim&pullRequest=307&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=manusa_electronim&pullRequest=307&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=manusa_electronim&pullRequest=307&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=CODE_SMELL)

[![97.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png '97.0%')](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_coverage&view=list) [97.0% Coverage](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_coverage&view=list)  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=manusa_electronim&pullRequest=307)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=manusa_electronim&pullRequest=307&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=manusa_electronim&pullRequest=307&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=manusa_electronim&pullRequest=307&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=manusa_electronim&pullRequest=307&resolved=false&types=CODE_SMELL)

[![97.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png '97.0%')](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_coverage&view=list) [97.0% Coverage](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_coverage&view=list)  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=manusa_electronim&pullRequest=307&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/.eslintrc b/.eslintrc
index 8081631..515cab5 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -115,7 +115,7 @@
     "indent": [2, 2, {
       "SwitchCase": 1
     }],
-    "arrow-body-style": [2, "as-needed"], // Consider disabling this one: https://twitter.com/dan_abramov/status/1570426739591114755
+    "arrow-body-style": 0, // Consider disabling this one: https://twitter.com/dan_abramov/status/1570426739591114755
     "arrow-parens": [2, "as-needed"],
     "arrow-spacing": 2,
     "brace-style": 2,
diff --git a/README.md b/README.md
index e0fc3f4..6a78be8 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@ electronim
 ## Features
 
 - ⚛ Multi-platform: ElectronIM is available for Linux 🐧, Mac 🍏 and Windows.
-- 🌍 Based on Chromium 112
+- 🌍 Based on Chromium 114
 - 🔔 Desktop notifications: ElectronIM will notify you using your native system notifications.
 - 🧐 Spellchecker: ElectronIM contains spellchecker dictionaries for many languages,
   if your language is not supported, just [file an issue](https://github.com/manusa/electronim/issues/new).
diff --git a/build-config/electronim.nuspec b/build-config/electronim.nuspec
index b130dec..6f7529c 100644
--- a/build-config/electronim.nuspec
+++ b/build-config/electronim.nuspec
@@ -24,7 +24,7 @@ Improve your productivity by combining all your instant messaging applications (
 ### Features
 
 - ⚛ Multi-platform: ElectronIM is available for Linux 🐧, Mac 🍏 and Windows.
-- 🌍 Based on Chromium 112
+- 🌍 Based on Chromium 114
 - 🔔 Desktop notifications: ElectronIM will notify you using your native system notifications.
 - 🧐 Spellchecker: ElectronIM contains spellchecker dictionaries for many languages,
   if your language is not supported, just [file an issue](https://github.com/manusa/electronim/issues/new).
diff --git a/package-lock.json b/package-lock.json
index 2a9ad98..f68da0b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -29,7 +29,7 @@
         "dictionary-sv": "^3.0.1",
         "dictionary-tr": "^1.3.3",
         "dictionary-uk": "^2.1.1",
-        "electron": "24.4.1",
+        "electron": "25.0.1",
         "htm": "3.1.1",
         "markdown-it": "13.0.1",
         "nodehun": "3.0.2",
@@ -3633,9 +3633,9 @@
       }
     },
     "node_modules/electron": {
-      "version": "24.4.1",
-      "resolved": "https://registry.npmjs.org/electron/-/electron-24.4.1.tgz",
-      "integrity": "sha512-tVZw5/dKGJbU1h8bdY0gfz4Y7ANYi8VddnIiLg/sPidJWc4CdshCZhLfU0lW1ySjtEt35JYxGHfmerkJJqUSTw==",
+      "version": "25.0.1",
+      "resolved": "https://registry.npmjs.org/electron/-/electron-25.0.1.tgz",
+      "integrity": "sha512-YD3xCrH01LiPeLlG90DWgMXJK69UxY4NiXKqXT12HOiXLqEaKrLWap+CiiS7J7SWUXz+4XOItQI8g1dtG7zkkA==",
       "hasInstallScript": true,
       "dependencies": {
         "@electron/get": "^2.0.0",
@@ -11452,9 +11452,9 @@
       }
     },
     "electron": {
-      "version": "24.4.1",
-      "resolved": "https://registry.npmjs.org/electron/-/electron-24.4.1.tgz",
-      "integrity": "sha512-tVZw5/dKGJbU1h8bdY0gfz4Y7ANYi8VddnIiLg/sPidJWc4CdshCZhLfU0lW1ySjtEt35JYxGHfmerkJJqUSTw==",
+      "version": "25.0.1",
+      "resolved": "https://registry.npmjs.org/electron/-/electron-25.0.1.tgz",
+      "integrity": "sha512-YD3xCrH01LiPeLlG90DWgMXJK69UxY4NiXKqXT12HOiXLqEaKrLWap+CiiS7J7SWUXz+4XOItQI8g1dtG7zkkA==",
       "requires": {
         "@electron/get": "^2.0.0",
         "@types/node": "^18.11.18",
diff --git a/package.json b/package.json
index 2bf28e2..2b376f6 100644
--- a/package.json
+++ b/package.json
@@ -222,7 +222,7 @@
     "dictionary-sv": "^3.0.1",
     "dictionary-tr": "^1.3.3",
     "dictionary-uk": "^2.1.1",
-    "electron": "24.4.1",
+    "electron": "25.0.1",
     "htm": "3.1.1",
     "markdown-it": "13.0.1",
     "nodehun": "3.0.2",
diff --git a/src/browser-window/index.js b/src/browser-window/index.js
index 5d18cc1..d0c5e28 100644
--- a/src/browser-window/index.js
+++ b/src/browser-window/index.js
@@ -15,9 +15,9 @@
  */
 const {registerAppShortcuts} = require('./keyboard-shortcuts');
 
-const showDialog = (window, browserView) => {
-  window.setBrowserView(browserView);
-  const {width, height} = window.getContentBounds();
+const showDialog = (browserWindow, browserView) => {
+  browserWindow.setBrowserView(browserView);
+  const {width, height} = browserWindow.getContentBounds();
   browserView.setBounds({x: 0, y: 0, width, height});
   browserView.setAutoResize({width: false, horizontal: false, height: false, vertical: false});
   browserView.webContents.focus();
diff --git a/src/chrome-tabs/index.js b/src/chrome-tabs/index.js
index 24ce66b..fbe0d64 100644
--- a/src/chrome-tabs/index.js
+++ b/src/chrome-tabs/index.js
@@ -37,8 +37,7 @@ const checkForUpdates = webContents => {
     .catch(e => console.debug('Error checking for updates', e));
 };
 
-const handleContextMenu = (event, params) => {
-  const webContents = event.sender;
+const handleContextMenu = viewOrWindow => (event, params) => {
   const menu = new Menu();
   menu.append(new MenuItem({
     label: 'Settings',
@@ -50,7 +49,7 @@ const handleContextMenu = (event, params) => {
   }));
   menu.append(new MenuItem({
     label: 'DevTools',
-    click: () => webContents.openDevTools({mode: 'detach', activate: true})
+    click: () => viewOrWindow.webContents.openDevTools({mode: 'detach', activate: true})
   }));
   const {x, y} = params;
   menu.popup({x, y});
@@ -66,7 +65,7 @@ const newTabContainer = () => {
   tabContainer.setAutoResize({width: false, horizontal: false, height: false, vertical: false});
   tabContainer.webContents.loadURL(`file://${__dirname}/index.html`,
     {extraHeaders: 'pragma: no-cache\nCache-control: no-cache'});
-  tabContainer.webContents.on('context-menu', handleContextMenu);
+  tabContainer.webContents.on('context-menu', handleContextMenu(tabContainer));
   eventBus.once(APP_EVENTS.tabsReady, () => checkForUpdates(tabContainer.webContents));
   setInterval(() => checkForUpdates(tabContainer.webContents), 1000 * 60 * 30).unref();
   return tabContainer;
diff --git a/src/help/index.js b/src/help/index.js
index 2a99cb2..c2a50ed 100644
--- a/src/help/index.js
+++ b/src/help/index.js
@@ -13,7 +13,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
  */
-const {BrowserView, BrowserWindow} = require('electron');
+const {BrowserView} = require('electron');
 const path = require('path');
 const {showDialog} = require('../browser-window');
 const {handleRedirect, windowOpenHandler} = require('../tab-manager/redirect');
@@ -25,12 +25,12 @@ const webPreferences = {
   preload: path.resolve(__dirname, '..', '..', 'bundles', 'help.preload.js')
 };
 
-const openHelpDialog = event => {
+const openHelpDialog = browserWindow => () => {
   const helpView = new BrowserView({webPreferences});
   helpView.webContents.loadURL(`file://${__dirname}/index.html`);
   helpView.webContents.on('will-navigate', handleRedirect(helpView));
   helpView.webContents.setWindowOpenHandler(windowOpenHandler(helpView));
-  showDialog(BrowserWindow.fromWebContents(event.sender), helpView);
+  showDialog(browserWindow, helpView);
 };
 
 module.exports = {openHelpDialog};
diff --git a/src/main/index.js b/src/main/index.js
index af076de..57ff32e 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -68,19 +68,18 @@ const activateTab = tabId => {
   }
 };
 
-const handleMainWindowResize = event => {
-  const window = event.sender;
-  const [windowWidth, windowHeight] = window.getSize();
+const handleMainWindowResize = () => {
+  const [windowWidth, windowHeight] = mainWindow.getSize();
   updateSettings({width: windowWidth, height: windowHeight});
 
   setTimeout(() => {
-    const {width: contentWidth, height: contentHeight} = window.getContentBounds();
+    const {width: contentWidth, height: contentHeight} = mainWindow.getContentBounds();
     if (appMenu && appMenu.setBounds) {
       appMenu.setBounds({x: 0, y: 0, width: contentWidth, height: contentHeight});
     }
     let totalHeight = 0;
     const isLast = (idx, array) => idx === array.length - 1;
-    window.getBrowserViews().filter(isNotAppMenu).forEach((bv, idx, array) => {
+    mainWindow.getBrowserViews().filter(isNotAppMenu).forEach((bv, idx, array) => {
       const {x: currentX, y: currentY, height: currentHeight} = bv.getBounds();
       let newHeight = currentHeight;
       if (isLast(idx, array)) {
@@ -228,7 +227,7 @@ const initGlobalListeners = () => {
   eventBus.handle(APP_EVENTS.dictionaryGetAvailableNative, getAvailableNativeDictionaries);
   eventBus.handle(APP_EVENTS.dictionaryGetEnabled, getEnabledDictionaries);
   eventBus.on(APP_EVENTS.fullscreenToggle, fullscreenToggle);
-  eventBus.on(APP_EVENTS.helpOpenDialog, openHelpDialog);
+  eventBus.on(APP_EVENTS.helpOpenDialog, openHelpDialog(mainWindow));
   eventBus.on(APP_EVENTS.quit, app.exit);
   eventBus.on(APP_EVENTS.restore, () => {
     mainWindow.restore();
diff --git a/src/spell-check/index.js b/src/spell-check/index.js
index f830744..45f8264 100644
--- a/src/spell-check/index.js
+++ b/src/spell-check/index.js
@@ -117,21 +117,21 @@ const menuItem = ({webContents, suggestion}) => new MenuItem({
   }
 });
 
-const contextMenuHandler = async (event, {misspelledWord}) => {
+const contextMenuHandler = async (webContents, {misspelledWord}) => {
   const ret = [];
   if (misspelledWord && misspelledWord.length > 0) {
     const suggestions = await fakeRendererWorker.webContents.executeJavaScript(`getSuggestions('${misspelledWord}')`);
     suggestions.forEach(suggestion =>
-      ret.push(menuItem({webContents: event.sender, suggestion})));
+      ret.push(menuItem({webContents, suggestion})));
   }
   return ret;
 };
 
-const contextMenuNativeHandler = (event, {misspelledWord, dictionarySuggestions = []}) => {
+const contextMenuNativeHandler = (webContents, {misspelledWord, dictionarySuggestions = []}) => {
   const ret = [];
   if (misspelledWord && misspelledWord.length > 0) {
     dictionarySuggestions.forEach(suggestion =>
-      ret.push(menuItem({webContents: event.sender, suggestion})));
+      ret.push(menuItem({webContents, suggestion})));
   }
   return ret;
 };
diff --git a/src/tab-manager/context-menu.js b/src/tab-manager/context-menu.js
index 260bc64..d04284b 100644
--- a/src/tab-manager/context-menu.js
+++ b/src/tab-manager/context-menu.js
@@ -16,8 +16,7 @@
 const {Menu, MenuItem} = require('electron');
 const {contextMenuHandler, contextMenuNativeHandler} = require('../spell-check');
 
-const entries = (event, params) => {
-  const webContents = event.sender;
+const entries = ({webContents, params}) => {
   return [
     [{
       label: 'Back',
@@ -49,13 +48,13 @@ const entries = (event, params) => {
   ];
 };
 
-const spellCheckContextMenu = async (event, params) => {
+const spellCheckContextMenu = async ({webContents, params}) => {
   const menu = new Menu();
   let spellingSuggestions;
-  if (event.sender.session.spellcheck) {
-    spellingSuggestions = contextMenuNativeHandler(event, params);
+  if (webContents.session.spellcheck) {
+    spellingSuggestions = contextMenuNativeHandler(webContents, params);
   } else {
-    spellingSuggestions = await contextMenuHandler(event, params);
+    spellingSuggestions = await contextMenuHandler(webContents, params);
   }
   if (spellingSuggestions && spellingSuggestions.length > 0) {
     spellingSuggestions.forEach(mi => menu.append(mi));
@@ -63,10 +62,10 @@ const spellCheckContextMenu = async (event, params) => {
   return menu;
 };
 
-const regularContextMenu = (event, params) => {
+const regularContextMenu = ({webContents, params}) => {
   const menu = new Menu();
   const isVisible = me => !Object.keys(me).includes('visible') || me.visible === true;
-  entries(event, params).forEach((group, idx, arr) => {
+  entries({webContents, params}).forEach((group, idx, arr) => {
     for (const entry of group) {
       menu.append(new MenuItem({...entry}));
     }
@@ -77,12 +76,17 @@ const regularContextMenu = (event, params) => {
   return menu;
 };
 
-const handleContextMenu = async (event, params) => {
+/**
+ * @param {BrowserView|BrowserWindow} viewOrWindow
+ * @returns {(function(*, *): Promise<void>)|*}
+ */
+const handleContextMenu = viewOrWindow => async (_event, params) => {
+  const {webContents} = viewOrWindow;
   let menu;
   if (params.misspelledWord) {
-    menu = await spellCheckContextMenu(event, params);
+    menu = await spellCheckContextMenu({webContents, params});
   } else {
-    menu = regularContextMenu(event, params);
+    menu = regularContextMenu({webContents, params});
   }
   const {x, y} = params;
   menu.popup({x, y});
diff --git a/src/tab-manager/index.js b/src/tab-manager/index.js
index af774b9..23ac247 100644
--- a/src/tab-manager/index.js
+++ b/src/tab-manager/index.js
@@ -103,7 +103,7 @@ const addTabs = ipcSender => tabsMetadata => {
     const handlePageFaviconUpdatedForCurrentTab = handlePageFaviconUpdated(tab, ipcSender, id);
     tab.webContents.on('page-favicon-updated', handlePageFaviconUpdatedForCurrentTab);
 
-    tab.webContents.on('context-menu', handleContextMenu);
+    tab.webContents.on('context-menu', handleContextMenu(tab));
 
     const registerIdInTab = () => tab.webContents.executeJavaScript(`window.tabId = '${id}';`);
     tab.webContents.on('dom-ready', registerIdInTab);


Test patch:
diff --git a/src/help/__tests__/index.test.js b/src/help/__tests__/index.test.js
index 0f1f406..f72d06f 100644
--- a/src/help/__tests__/index.test.js
+++ b/src/help/__tests__/index.test.js
@@ -15,20 +15,22 @@
  */
 describe('Help module test suite', () => {
   let electron;
-  let sender;
   let help;
   beforeEach(() => {
     jest.resetModules();
     jest.mock('electron', () => require('../../__tests__').mockElectronInstance());
     electron = require('electron');
-    sender = electron.browserWindowInstance.webContents;
     help = require('../');
   });
   describe('openHelpDialog', () => {
+    let openHelp;
+    beforeEach(() => {
+      openHelp = help.openHelpDialog(electron.browserWindowInstance);
+    });
     describe('webPreferences', () => {
       test('is sandboxed', () => {
         // When
-        help.openHelpDialog({sender});
+        openHelp();
         // Then
         const BrowserView = electron.BrowserView;
         expect(BrowserView).toHaveBeenCalledTimes(1);
@@ -38,7 +40,7 @@ describe('Help module test suite', () => {
       });
       test('has no node integration', () => {
         // When
-        help.openHelpDialog({sender});
+        openHelp();
         // Then
         expect(electron.BrowserView).toHaveBeenCalledWith({
           webPreferences: expect.objectContaining({nodeIntegration: false})
@@ -46,7 +48,7 @@ describe('Help module test suite', () => {
       });
       test('has context isolation', () => {
         // When
-        help.openHelpDialog({sender});
+        openHelp();
         // Then
         expect(electron.BrowserView).toHaveBeenCalledWith({
           webPreferences: expect.objectContaining({contextIsolation: true})
@@ -56,7 +58,7 @@ describe('Help module test suite', () => {
     test('hasWindowOpenHandler', () => {
       // Given
       electron.browserViewInstance.webContents.getURL.mockReturnValue('file://help/index.html');
-      help.openHelpDialog({sender});
+      openHelp();
       // When
       electron.browserViewInstance.webContents.setWindowOpenHandler.mock.calls[0][0]({url: 'https://example.com'});
       // Then
@@ -64,7 +66,7 @@ describe('Help module test suite', () => {
     });
     test('should open dialog and add event listeners', () => {
       // When
-      help.openHelpDialog({sender: electron.browserWindowInstance.webContents});
+      openHelp();
       // Then
       expect(electron.browserViewInstance.webContents.loadURL).toHaveBeenCalledTimes(1);
       expect(electron.browserViewInstance.webContents.loadURL)
diff --git a/src/tab-manager/__tests__/context-menu.test.js b/src/tab-manager/__tests__/context-menu.test.js
index 05ce9f4..69e664e 100644
--- a/src/tab-manager/__tests__/context-menu.test.js
+++ b/src/tab-manager/__tests__/context-menu.test.js
@@ -43,7 +43,6 @@ describe('Tab Manager context-menu test suite', () => {
     electron.browserViewInstance.webContents.canGoBack = jest.fn(() => false);
     listeners = electron.browserViewInstance.listeners;
     event = new Event('');
-    event.sender = electron.browserViewInstance.webContents;
     params = {x: 13, y: 37};
     tabManager = require('../');
     tabManager.addTabs({send: jest.fn()})([{id: '1337', url: 'https://localhost'}]);