Add stub value to proxy port to make unrelated tests pass

Note: the actual mechanism to set a value for the port is not in scope of behavioral tests yet.

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>

# Conflicts:
#	src/behaviours/quitting-and-restarting-the-app/opening-application-window-using-tray.test.ts
#	src/main/start-main-application/lens-window/application-window/create-lens-window.injectable.ts
This commit is contained in:
Iku-turso authored and Janne Savolainen committed 2022-06-15 08:41:39 +03:00
1 parent 53430ab611
commit 116e8c1118
2 files changed
+4 -11

No files matched your search

@@ -10,15 +10,9 @@ import applicationWindowInjectable from "../../main/start-main-application/lens-
import createElectronWindowForInjectable from "../../main/start-main-application/lens-window/application-window/create-electron-window.injectable";
import type { AsyncFnMock } from "@async-fn/jest";
import asyncFn from "@async-fn/jest";
import type {
ElectronWindow,
LensWindowConfiguration,
} from "../../main/start-main-application/lens-window/application-window/create-lens-window.injectable";
import type { ElectronWindow, LensWindowConfiguration } from "../../main/start-main-application/lens-window/application-window/create-lens-window.injectable";
import type { DiContainer } from "@ogre-tools/injectable";
import { flushPromises } from "../../common/test-utils/flush-promises";
import lensProxyPortInjectable from "../../main/lens-proxy/lens-proxy-port.injectable";
import lensResourcesDirInjectable from "../../common/vars/lens-resources-dir.injectable";
describe("opening application window using tray", () => {
@@ -63,10 +57,6 @@ describe("opening application window using tray", () => {
callForSplashWindowHtmlMock = asyncFn();
callForApplicationWindowHtmlMock = asyncFn();
const lensProxyPort = mainDi.inject(lensProxyPortInjectable);
lensProxyPort.set(42);
},
);
@@ -56,6 +56,7 @@ import assert from "assert";
import { openMenu } from "react-select-event";
import userEvent from "@testing-library/user-event";
import { StatusBar } from "../status-bar/status-bar";
import lensProxyPortInjectable from "../../../main/lens-proxy/lens-proxy-port.injectable";
type Callback = (dis: DiContainers) => void | Promise<void>;
@@ -398,6 +399,8 @@ export const getApplicationBuilder = () => {
},
async render() {
mainDi.inject(lensProxyPortInjectable).set(42);
for (const callback of beforeApplicationStartCallbacks) {
await callback(dis);
}