From 5b65a9384995b32834f5a3aceb638d152326033b Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Wed, 4 May 2022 13:40:03 +0300 Subject: [PATCH] Fix code style Co-authored-by: Mikko Aspiala Signed-off-by: Janne Savolainen --- .../navigation-to-helm-charts.test.ts | 18 ++---------------- src/common/__tests__/hotbar-store.test.ts | 1 + src/main/__test__/context-handler.test.ts | 7 +++---- .../kubeconfig-sync-manager.ts | 3 ++- src/main/k8s-request.injectable.ts | 3 ++- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/behaviours/helm-charts/navigation-to-helm-charts.test.ts b/src/behaviours/helm-charts/navigation-to-helm-charts.test.ts index b6e496381c..c539db173a 100644 --- a/src/behaviours/helm-charts/navigation-to-helm-charts.test.ts +++ b/src/behaviours/helm-charts/navigation-to-helm-charts.test.ts @@ -3,28 +3,14 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import type { RenderResult } from "@testing-library/react"; -import { - ApplicationBuilder, - getApplicationBuilder, -} from "../../renderer/components/test-utils/get-application-builder"; +import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; +import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder"; describe("helm-charts - navigation to Helm charts", () => { let applicationBuilder: ApplicationBuilder; beforeEach(() => { applicationBuilder = getApplicationBuilder(); - - // applicationBuilder.beforeSetups(({ rendererDi }) => { - // const userStoreStub = { - // extensionRegistryUrl: { customUrl: "some-custom-url" }, - // } as unknown as UserStore; - // - // rendererDi.override(userStoreInjectable, () => userStoreStub); - // - // const themeStoreStub = ({ themeOptions: [] }) as unknown as ThemeStore; - // - // rendererDi.override(themeStoreInjectable, () => themeStoreStub); - // }); }); describe("when navigating to Helm charts", () => { diff --git a/src/common/__tests__/hotbar-store.test.ts b/src/common/__tests__/hotbar-store.test.ts index 1364b8a337..b8fba6b100 100644 --- a/src/common/__tests__/hotbar-store.test.ts +++ b/src/common/__tests__/hotbar-store.test.ts @@ -85,6 +85,7 @@ describe("HotbarStore", () => { di.unoverride(hotbarStoreInjectable); di.override(catalogEntityRegistryInjectable, () => ({ + // eslint-disable-next-line unused-imports/no-unused-vars-ts addComputedSource: (id, source) => {}, items: [ getMockCatalogEntity({ diff --git a/src/main/__test__/context-handler.test.ts b/src/main/__test__/context-handler.test.ts index d314bbb5a5..c0bdb64126 100644 --- a/src/main/__test__/context-handler.test.ts +++ b/src/main/__test__/context-handler.test.ts @@ -5,15 +5,14 @@ import { UserStore } from "../../common/user-store"; import type { ContextHandler } from "../context-handler/context-handler"; -import type { PrometheusService } from "../prometheus"; -import { PrometheusProvider, PrometheusProviderRegistry } from "../prometheus"; +import type { PrometheusService, PrometheusProviderRegistry } from "../prometheus"; +import { PrometheusProvider } from "../prometheus"; import mockFs from "mock-fs"; import { getDiForUnitTesting } from "../getDiForUnitTesting"; import createContextHandlerInjectable from "../context-handler/create-context-handler.injectable"; import type { Cluster } from "../../common/cluster/cluster"; import createKubeAuthProxyInjectable from "../kube-auth-proxy/create-kube-auth-proxy.injectable"; -import prometheusProviderRegistryInjectable - from "../prometheus/prometheus-provider-registry.injectable"; +import prometheusProviderRegistryInjectable from "../prometheus/prometheus-provider-registry.injectable"; jest.mock("electron", () => ({ app: { diff --git a/src/main/catalog-sources/kubeconfig-sync-manager/kubeconfig-sync-manager.ts b/src/main/catalog-sources/kubeconfig-sync-manager/kubeconfig-sync-manager.ts index 9d6c544cd4..8b6aab18a0 100644 --- a/src/main/catalog-sources/kubeconfig-sync-manager/kubeconfig-sync-manager.ts +++ b/src/main/catalog-sources/kubeconfig-sync-manager/kubeconfig-sync-manager.ts @@ -17,7 +17,8 @@ import { bytesToUnits, getOrInsertWith, iter, noop } from "../../../common/utils import logger from "../../logger"; import type { KubeConfig } from "@kubernetes/client-node"; import { loadConfigFromString, splitConfig } from "../../../common/kube-helpers"; -import { catalogEntityFromCluster, ClusterManager } from "../../cluster-manager"; +import type { ClusterManager } from "../../cluster-manager"; +import { catalogEntityFromCluster } from "../../cluster-manager"; import { UserStore } from "../../../common/user-store"; import { ClusterStore } from "../../../common/cluster-store/cluster-store"; import { createHash } from "crypto"; diff --git a/src/main/k8s-request.injectable.ts b/src/main/k8s-request.injectable.ts index 82705cc8ce..daedcb2142 100644 --- a/src/main/k8s-request.injectable.ts +++ b/src/main/k8s-request.injectable.ts @@ -2,7 +2,8 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import request, { RequestPromiseOptions } from "request-promise-native"; +import type { RequestPromiseOptions } from "request-promise-native"; +import request from "request-promise-native"; import { apiKubePrefix } from "../common/vars"; import type { Cluster } from "../common/cluster/cluster"; import { getInjectable } from "@ogre-tools/injectable";