1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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 2022-06-10 17:21:44 +03:00 committed by Janne Savolainen
parent 53430ab611
commit 116e8c1118
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
2 changed files with 4 additions and 11 deletions

View File

@ -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 createElectronWindowForInjectable from "../../main/start-main-application/lens-window/application-window/create-electron-window.injectable";
import type { AsyncFnMock } from "@async-fn/jest"; import type { AsyncFnMock } from "@async-fn/jest";
import asyncFn 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 type { DiContainer } from "@ogre-tools/injectable";
import { flushPromises } from "../../common/test-utils/flush-promises"; 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"; import lensResourcesDirInjectable from "../../common/vars/lens-resources-dir.injectable";
describe("opening application window using tray", () => { describe("opening application window using tray", () => {
@ -63,10 +57,6 @@ describe("opening application window using tray", () => {
callForSplashWindowHtmlMock = asyncFn(); callForSplashWindowHtmlMock = asyncFn();
callForApplicationWindowHtmlMock = asyncFn(); callForApplicationWindowHtmlMock = asyncFn();
const lensProxyPort = mainDi.inject(lensProxyPortInjectable);
lensProxyPort.set(42);
}, },
); );

View File

@ -56,6 +56,7 @@ import assert from "assert";
import { openMenu } from "react-select-event"; import { openMenu } from "react-select-event";
import userEvent from "@testing-library/user-event"; import userEvent from "@testing-library/user-event";
import { StatusBar } from "../status-bar/status-bar"; import { StatusBar } from "../status-bar/status-bar";
import lensProxyPortInjectable from "../../../main/lens-proxy/lens-proxy-port.injectable";
type Callback = (dis: DiContainers) => void | Promise<void>; type Callback = (dis: DiContainers) => void | Promise<void>;
@ -398,6 +399,8 @@ export const getApplicationBuilder = () => {
}, },
async render() { async render() {
mainDi.inject(lensProxyPortInjectable).set(42);
for (const callback of beforeApplicationStartCallbacks) { for (const callback of beforeApplicationStartCallbacks) {
await callback(dis); await callback(dis);
} }