mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Adapt to injectable feature-wrappers
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
29 files changed
+79
-60
No files matched your search
+4
-1
@@ -4,6 +4,7 @@ import { EnlistMessageChannelListener, enlistMessageChannelListenerInjectionToke
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { registerFeature } from "@k8slens/feature-core";
|
||||
import { messagingFeatureForMain } from "../feature";
|
||||
import { runInAction } from "mobx";
|
||||
|
||||
describe("enlist message channel listener in main", () => {
|
||||
let enlistMessageChannelListener: EnlistMessageChannelListener;
|
||||
@@ -14,7 +15,9 @@ describe("enlist message channel listener in main", () => {
|
||||
beforeEach(() => {
|
||||
const di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
runInAction(() => {
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
});
|
||||
|
||||
onMock = jest.fn();
|
||||
offMock = jest.fn();
|
||||
|
||||
+4
-1
@@ -9,6 +9,7 @@ import { getPromiseStatus } from "@k8slens/test-utils";
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { registerFeature } from "@k8slens/feature-core";
|
||||
import { messagingFeatureForMain } from "../feature";
|
||||
import { runInAction } from "mobx";
|
||||
|
||||
type TestRequestChannel = RequestChannel<unknown, unknown>;
|
||||
|
||||
@@ -25,7 +26,9 @@ describe("enlist request channel listener in main", () => {
|
||||
beforeEach(() => {
|
||||
const di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
runInAction(() => {
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
});
|
||||
|
||||
handleMock = jest.fn();
|
||||
offMock = jest.fn();
|
||||
|
||||
@@ -3,6 +3,7 @@ import { registerFeature } from "@k8slens/feature-core";
|
||||
import ipcMainInjectable from "./ipc-main.injectable";
|
||||
import { ipcMain } from "electron";
|
||||
import { messagingFeatureForMain } from "../feature";
|
||||
import { runInAction } from "mobx";
|
||||
|
||||
describe("ipc-main", () => {
|
||||
let di: DiContainer;
|
||||
@@ -10,7 +11,9 @@ describe("ipc-main", () => {
|
||||
beforeEach(() => {
|
||||
di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
runInAction(() => {
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
});
|
||||
});
|
||||
|
||||
it("is the actual IPC-main of Electron", () => {
|
||||
|
||||
+4
-1
@@ -5,6 +5,7 @@ import { getMessageChannel, sendMessageToChannelInjectionToken } from "@k8slens/
|
||||
import getWebContentsInjectable from "./get-web-contents.injectable";
|
||||
import type { WebContents } from "electron";
|
||||
import allowCommunicationListenerInjectable from "./allow-communication-listener.injectable";
|
||||
import { runInAction } from "mobx";
|
||||
|
||||
const someChannel = getMessageChannel<string>("some-channel");
|
||||
|
||||
@@ -14,7 +15,9 @@ describe("send-message-to-channel", () => {
|
||||
beforeEach(() => {
|
||||
di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
runInAction(() => {
|
||||
registerFeature(di, messagingFeatureForMain);
|
||||
});
|
||||
});
|
||||
|
||||
it("given no web contents, when sending a message, does not do anything", () => {
|
||||
|
||||
Reference in new issue
Block a user