mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix tests
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
55ce80ea3f
commit
1feb8748b0
@ -7,20 +7,50 @@ import "@testing-library/jest-dom/extend-expect";
|
|||||||
import { MainLayoutHeader } from "../main-layout-header";
|
import { MainLayoutHeader } from "../main-layout-header";
|
||||||
import { Cluster } from "../../../../main/cluster";
|
import { Cluster } from "../../../../main/cluster";
|
||||||
import { ClusterStore } from "../../../../common/cluster-store";
|
import { ClusterStore } from "../../../../common/cluster-store";
|
||||||
|
import mockFs from "mock-fs";
|
||||||
|
|
||||||
const cluster: Cluster = new Cluster({
|
describe("<MainLayoutHeader />", () => {
|
||||||
|
let cluster: Cluster;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
const mockOpts = {
|
||||||
|
"minikube-config.yml": JSON.stringify({
|
||||||
|
apiVersion: "v1",
|
||||||
|
clusters: [{
|
||||||
|
name: "minikube",
|
||||||
|
cluster: {
|
||||||
|
server: "https://192.168.64.3:8443",
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
contexts: [{
|
||||||
|
context: {
|
||||||
|
cluster: "minikube",
|
||||||
|
user: "minikube",
|
||||||
|
},
|
||||||
|
name: "minikube",
|
||||||
|
}],
|
||||||
|
users: [{
|
||||||
|
name: "minikube",
|
||||||
|
}],
|
||||||
|
kind: "Config",
|
||||||
|
preferences: {},
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
mockFs(mockOpts);
|
||||||
|
|
||||||
|
ClusterStore.createInstance();
|
||||||
|
|
||||||
|
cluster = new Cluster({
|
||||||
id: "foo",
|
id: "foo",
|
||||||
contextName: "minikube",
|
contextName: "minikube",
|
||||||
kubeConfigPath: "minikube-config.yml",
|
kubeConfigPath: "minikube-config.yml",
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("<MainLayoutHeader />", () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
ClusterStore.createInstance();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
ClusterStore.resetInstance();
|
ClusterStore.resetInstance();
|
||||||
|
mockFs.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders w/o errors", () => {
|
it("renders w/o errors", () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user