mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fixup
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
4d8c26d587
commit
bc0b2e8d0a
@ -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 { createContainer, DiContainer } from "@ogre-tools/injectable";
|
||||||
import { registerFeature } from "@k8slens/feature-core";
|
import { registerFeature } from "@k8slens/feature-core";
|
||||||
import ipcRendererInjectable from "./ipc-renderer.injectable";
|
import ipcRendererInjectable from "./ipc-renderer.injectable";
|
||||||
import { feature } from "../feature";
|
import { messagingFeatureForRenderer } from "../feature";
|
||||||
import { ipcRenderer } from "electron";
|
import { ipcRenderer } from "electron";
|
||||||
|
|
||||||
describe("ipc-renderer", () => {
|
describe("ipc-renderer", () => {
|
||||||
@ -10,7 +10,7 @@ describe("ipc-renderer", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
di = createContainer("irrelevant");
|
di = createContainer("irrelevant");
|
||||||
|
|
||||||
registerFeature(di, feature);
|
registerFeature(di, messagingFeatureForRenderer);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("is not undefined", () => {
|
it("is not undefined", () => {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
} from "@k8slens/messaging";
|
} from "@k8slens/messaging";
|
||||||
import { createContainer } from "@ogre-tools/injectable";
|
import { createContainer } from "@ogre-tools/injectable";
|
||||||
import { registerFeature } from "@k8slens/feature-core";
|
import { registerFeature } from "@k8slens/feature-core";
|
||||||
import { feature } from "../feature";
|
import { messagingFeatureForRenderer } from "../feature";
|
||||||
|
|
||||||
describe("enlist message channel listener in renderer", () => {
|
describe("enlist message channel listener in renderer", () => {
|
||||||
let enlistMessageChannelListener: EnlistMessageChannelListener;
|
let enlistMessageChannelListener: EnlistMessageChannelListener;
|
||||||
@ -17,7 +17,7 @@ describe("enlist message channel listener in renderer", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const di = createContainer("irrelevant");
|
const di = createContainer("irrelevant");
|
||||||
|
|
||||||
registerFeature(di, feature);
|
registerFeature(di, messagingFeatureForRenderer);
|
||||||
|
|
||||||
onMock = jest.fn();
|
onMock = jest.fn();
|
||||||
offMock = jest.fn();
|
offMock = jest.fn();
|
||||||
|
|||||||
@ -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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Loading…
Reference in New Issue
Block a user