Fix hotbar migration of workspaces (#3178)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-06-25 09:55:25 -04:00
1 parent b9dfd20a93
commit 51655884c7
39 files changed
+333 -446

No files matched your search

+13
View File
@@ -22,6 +22,14 @@
import { UserStore } from "../../common/user-store";
import { ContextHandler } from "../context-handler";
import { PrometheusProvider, PrometheusProviderRegistry, PrometheusService } from "../prometheus";
import mockFs from "mock-fs";
jest.mock("electron", () => ({
app: {
getPath: () => "tmp",
setLoginItemSettings: jest.fn(),
},
}));
enum ServiceResult {
Success,
@@ -70,6 +78,10 @@ function getHandler() {
describe("ContextHandler", () => {
beforeEach(() => {
mockFs({
"tmp": {}
});
PrometheusProviderRegistry.createInstance();
UserStore.createInstance();
});
@@ -77,6 +89,7 @@ describe("ContextHandler", () => {
afterEach(() => {
PrometheusProviderRegistry.resetInstance();
UserStore.resetInstance();
mockFs.restore();
});
describe("getPrometheusService", () => {
+6 -4
View File
@@ -46,7 +46,8 @@ jest.mock("winston", () => ({
jest.mock("electron", () => ({
app: {
getPath: () => "/foo",
getPath: () => "tmp",
setLoginItemSettings: jest.fn(),
},
}));
@@ -77,8 +78,6 @@ const mockWaitUntilUsed = waitUntilUsed as jest.MockedFunction<typeof waitUntilU
describe("kube auth proxy tests", () => {
beforeEach(() => {
jest.clearAllMocks();
UserStore.resetInstance();
UserStore.createInstance();
const mockMinikubeConfig = {
"minikube-config.yml": JSON.stringify({
@@ -102,13 +101,16 @@ describe("kube auth proxy tests", () => {
}],
kind: "Config",
preferences: {},
})
}),
"tmp": {},
};
mockFs(mockMinikubeConfig);
UserStore.createInstance();
});
afterEach(() => {
UserStore.resetInstance();
mockFs.restore();
});