mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
4 files changed
+4
-80
No files matched your search
@@ -1,38 +0,0 @@
|
||||
import { createContainer, getInjectable } from "@ogre-tools/injectable";
|
||||
import { registerFeature } from "@k8slens/feature-core";
|
||||
import { feature } from "./feature";
|
||||
import { listeningOfChannelsInjectionToken } from "@k8slens/messaging";
|
||||
import { getStartableStoppable } from "@k8slens/startable-stoppable";
|
||||
import { runManyFor } from "@k8slens/run-many";
|
||||
import { onLoadOfApplicationInjectionToken } from "@k8slens/application";
|
||||
|
||||
describe("listening-of-channels", () => {
|
||||
it("when on application load, starts listening of channels", async () => {
|
||||
const di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, feature);
|
||||
|
||||
const listeningOfChannelsMock = jest.fn(() => () => {});
|
||||
|
||||
const listeningOfChannelsInjectableStub = getInjectable({
|
||||
id: "some-runnable",
|
||||
|
||||
instantiate: () =>
|
||||
getStartableStoppable("some-listening-of-channels-implementation", () =>
|
||||
listeningOfChannelsMock()
|
||||
),
|
||||
|
||||
injectionToken: listeningOfChannelsInjectionToken,
|
||||
});
|
||||
|
||||
di.register(listeningOfChannelsInjectableStub);
|
||||
|
||||
const onLoadOfApplication = runManyFor(di)(
|
||||
onLoadOfApplicationInjectionToken
|
||||
);
|
||||
|
||||
await onLoadOfApplication();
|
||||
|
||||
expect(listeningOfChannelsMock).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createContainer, DiContainer } from "@ogre-tools/injectable";
|
||||
import { registerFeature } from "@k8slens/feature-core";
|
||||
import ipcRendererInjectable from "./ipc-renderer.injectable";
|
||||
import { feature } from "../feature";
|
||||
import { messagingFeatureForRenderer } from "../feature";
|
||||
import { ipcRenderer } from "electron";
|
||||
|
||||
describe("ipc-renderer", () => {
|
||||
@@ -10,7 +10,7 @@ describe("ipc-renderer", () => {
|
||||
beforeEach(() => {
|
||||
di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, feature);
|
||||
registerFeature(di, messagingFeatureForRenderer);
|
||||
});
|
||||
|
||||
it("is not undefined", () => {
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import {
|
||||
} from "@k8slens/messaging";
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { registerFeature } from "@k8slens/feature-core";
|
||||
import { feature } from "../feature";
|
||||
import { messagingFeatureForRenderer } from "../feature";
|
||||
|
||||
describe("enlist message channel listener in renderer", () => {
|
||||
let enlistMessageChannelListener: EnlistMessageChannelListener;
|
||||
@@ -17,7 +17,7 @@ describe("enlist message channel listener in renderer", () => {
|
||||
beforeEach(() => {
|
||||
const di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, feature);
|
||||
registerFeature(di, messagingFeatureForRenderer);
|
||||
|
||||
onMock = jest.fn();
|
||||
offMock = jest.fn();
|
||||
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
import { createContainer, getInjectable } from "@ogre-tools/injectable";
|
||||
import { registerFeature } from "@k8slens/feature-core";
|
||||
import { messagingFeatureForRenderer } from "../feature";
|
||||
import { listeningOfChannelsInjectionToken } from "@k8slens/messaging";
|
||||
import { getStartableStoppable } from "@k8slens/startable-stoppable";
|
||||
import { runManyFor } from "@k8slens/run-many";
|
||||
import { onLoadOfApplicationInjectionToken } from "@k8slens/application";
|
||||
|
||||
describe("listening-of-channels", () => {
|
||||
it("when before frame starts, starts listening of channels", async () => {
|
||||
const di = createContainer("irrelevant");
|
||||
|
||||
registerFeature(di, messagingFeatureForRenderer);
|
||||
|
||||
const listeningOfChannelsMock = jest.fn(() => () => {});
|
||||
|
||||
const listeningOfChannelsInjectableStub = getInjectable({
|
||||
id: "some-runnable",
|
||||
|
||||
instantiate: () =>
|
||||
getStartableStoppable("some-listening-of-channels-implementation", () =>
|
||||
listeningOfChannelsMock()
|
||||
),
|
||||
|
||||
injectionToken: listeningOfChannelsInjectionToken,
|
||||
});
|
||||
|
||||
di.register(listeningOfChannelsInjectableStub);
|
||||
|
||||
const onLoadOfApplication = runManyFor(di)(
|
||||
onLoadOfApplicationInjectionToken
|
||||
);
|
||||
|
||||
await onLoadOfApplication();
|
||||
|
||||
expect(listeningOfChannelsMock).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user