mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fixup test because of new injectables
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
eb5f6600aa
commit
6e65fdaf5e
@ -6,7 +6,6 @@
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type { AuthorizationV1Api, CoreV1Api, V1APIGroupList, V1APIVersions, V1NamespaceList, V1SelfSubjectAccessReview, V1SelfSubjectRulesReview } from "@kubernetes/client-node";
|
||||
import clusterStoreInjectable from "../../common/cluster-store/cluster-store.injectable";
|
||||
import type { Cluster } from "../../common/cluster/cluster";
|
||||
import createAuthorizationApiInjectable from "../../common/cluster/create-authorization-api.injectable";
|
||||
import writeJsonFileInjectable from "../../common/fs/write-json-file.injectable";
|
||||
@ -26,6 +25,7 @@ import type { KubeAuthProxy } from "../../main/kube-auth-proxy/create-kube-auth-
|
||||
import createKubeAuthProxyInjectable from "../../main/kube-auth-proxy/create-kube-auth-proxy.injectable";
|
||||
import type { Mocked } from "../../test-utils/mock-interface";
|
||||
import { flushPromises } from "@k8slens/test-utils";
|
||||
import addClusterInjectable from "./storage/common/add.injectable";
|
||||
|
||||
describe("Refresh Cluster Accessibility Technical Tests", () => {
|
||||
let builder: ApplicationBuilder;
|
||||
@ -79,7 +79,7 @@ describe("Refresh Cluster Accessibility Technical Tests", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
const mainDi = builder.mainDi;
|
||||
const clusterStore = mainDi.inject(clusterStoreInjectable);
|
||||
const addCluster = mainDi.inject(addClusterInjectable);
|
||||
const writeJsonFile = mainDi.inject(writeJsonFileInjectable);
|
||||
|
||||
await writeJsonFile("/some-kube-config-path", {
|
||||
@ -103,13 +103,11 @@ describe("Refresh Cluster Accessibility Technical Tests", () => {
|
||||
}],
|
||||
});
|
||||
|
||||
clusterStore.addCluster({
|
||||
cluster = addCluster({
|
||||
contextName: "some-cluster-context",
|
||||
id: "some-cluster-id",
|
||||
kubeConfigPath: "/some-kube-config-path",
|
||||
});
|
||||
|
||||
cluster = clusterStore.getById("some-cluster-id") ?? (() => { throw new Error("missing cluster"); })();
|
||||
clusterConnection = mainDi.inject(clusterConnectionInjectable, cluster);
|
||||
refreshPromise = clusterConnection.refreshAccessibilityAndMetadata();
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user