Replace duplicated overrides with global

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne SavolainenandMikko Aspiala committed 2022-06-03 07:43:53 +03:00
1 parent 19b30df3a2
commit 885ce01f79
4 files changed
+17 -7

No files matched your search

+13 -2
View File
@@ -38,11 +38,12 @@ import { ApiManager } from "../common/k8s-api/api-manager";
import lensResourcesDirInjectable from "../common/vars/lens-resources-dir.injectable";
import broadcastMessageInjectable from "../common/ipc/broadcast-message.injectable";
import apiManagerInjectable from "../common/k8s-api/api-manager/manager.injectable";
import ipcRendererInjectable
from "./app-paths/get-value-from-registered-channel/ipc-renderer/ipc-renderer.injectable";
import ipcRendererInjectable from "./app-paths/get-value-from-registered-channel/ipc-renderer/ipc-renderer.injectable";
import type { IpcRenderer } from "electron";
import setupOnApiErrorListenersInjectable from "./api/setup-on-api-errors.injectable";
import { observable } from "mobx";
import defaultShellInjectable from "./components/+preferences/default-shell.injectable";
import themeStoreInjectable from "./themes/store.injectable";
export const getDiForUnitTesting = (opts: GetDiForUnitTestingOptions = {}) => {
const {
@@ -100,6 +101,8 @@ export const getDiForUnitTesting = (opts: GetDiForUnitTestingOptions = {}) => {
di.override(setupOnApiErrorListenersInjectable, () => ({ run: () => {} }));
di.override(defaultShellInjectable, () => "some-default-shell");
di.override(
userStoreInjectable,
() =>
@@ -128,6 +131,14 @@ export const getDiForUnitTesting = (opts: GetDiForUnitTestingOptions = {}) => {
info: noop,
silly: noop,
}));
di.override(themeStoreInjectable, () => ({
activeTheme: {
type: "some-active-theme-type",
},
themeOptions: [],
}));
}
return di;