diff --git a/packages/core/src/renderer/components/+namespaces/namespace-store.test.ts b/packages/core/src/renderer/components/+namespaces/namespace-store.test.ts index abe71f366a..fbcc0efcb9 100644 --- a/packages/core/src/renderer/components/+namespaces/namespace-store.test.ts +++ b/packages/core/src/renderer/components/+namespaces/namespace-store.test.ts @@ -12,6 +12,9 @@ import directoryForUserDataInjectable from "../../../common/app-paths/directory- import type { Fetch } from "../../../common/fetch/fetch.injectable"; import fetchInjectable from "../../../common/fetch/fetch.injectable"; import { Namespace, NamespaceApi } from "../../../common/k8s-api/endpoints"; +import type { DeleteResourceDescriptor } from "../../../common/k8s-api/kube-api"; +import type { KubeJsonApiData } from "../../../common/k8s-api/kube-json-api"; +import type { KubeJsonApiObjectMetadata, KubeObjectScope } from "../../../common/k8s-api/kube-object"; import hostedClusterInjectable from "../../cluster-frame-context/hosted-cluster.injectable"; import createClusterInjectable from "../../cluster/create-cluster.injectable"; import { getDiForUnitTesting } from "../../getDiForUnitTesting"; @@ -106,15 +109,12 @@ const levelDeepSubChildA = createNamespace("level-deep-subchild-a", { "level-deep-subchild-a.tree.hnc.x-k8s.io/depth": "0", }); -const deleteNamespaceMock = jest.spyOn(NamespaceApi.prototype, "delete") - .mockImplementation(); - -const removeSubnamespaceMock = jest.fn(); - describe("NamespaceStore", () => { let di: DiContainer; let namespaceStore: NamespaceStore; let fetchMock: AsyncFnMock; + let deleteNamespaceMock: jest.SpyInstance, unknown, unknown>>, [DeleteResourceDescriptor]> + let removeSubnamespaceMock: jest.Mock beforeEach(async () => { di = getDiForUnitTesting({ doGeneralOverrides: true }); @@ -126,6 +126,9 @@ describe("NamespaceStore", () => { di.override(storesAndApisCanBeCreatedInjectable, () => true); di.override(removeSubnamespaceInjectable, () => removeSubnamespaceMock); + deleteNamespaceMock = jest.spyOn(NamespaceApi.prototype, "delete").mockImplementation(); + removeSubnamespaceMock = jest.fn(); + const createCluster = di.inject(createClusterInjectable); di.override(hostedClusterInjectable, () => createCluster({