mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(tests): add clusters to tests
This commit is contained in:
@@ -68,7 +68,8 @@ beforeEach(() => {
|
||||
version: "0.15.0",
|
||||
clusterMembers: ["default"]
|
||||
}
|
||||
]
|
||||
],
|
||||
clusters: [["default"]]
|
||||
};
|
||||
alertStore.data.silences = {
|
||||
default: {
|
||||
|
||||
@@ -58,7 +58,8 @@ const MockGroupList = count => {
|
||||
}
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 0, healthy: 1, failed: 0 },
|
||||
instances: [{ name: "am", uri: "http://am", error: "" }]
|
||||
instances: [{ name: "am", uri: "http://am", error: "" }],
|
||||
clusters: [["am"]]
|
||||
};
|
||||
alertStore.data.groups = groups;
|
||||
};
|
||||
|
||||
@@ -36,7 +36,8 @@ describe("<Grid />", () => {
|
||||
it("renders FatalError if there's only one upstream and it's unhealthy", () => {
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 1, healthy: 0, failed: 1 },
|
||||
instances: [{ name: "am1", uri: "http://am1", error: "error" }]
|
||||
instances: [{ name: "am1", uri: "http://am1", error: "error" }],
|
||||
clusters: [["am1"]]
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<FatalError />");
|
||||
@@ -45,7 +46,8 @@ describe("<Grid />", () => {
|
||||
it("renders FatalError if there's only one upstream and it's unhealthy but without any error", () => {
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 1, healthy: 0, failed: 1 },
|
||||
instances: [{ name: "am1", uri: "http://am1", error: "" }]
|
||||
instances: [{ name: "am1", uri: "http://am1", error: "" }],
|
||||
clusters: [["am1"]]
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<AlertGrid />");
|
||||
@@ -58,7 +60,8 @@ describe("<Grid />", () => {
|
||||
{ name: "am1", uri: "http://am1", error: "error 1" },
|
||||
{ name: "am2", uri: "file:///mock", error: "" },
|
||||
{ name: "am3", uri: "http://am1", error: "error 2" }
|
||||
]
|
||||
],
|
||||
clusters: [["am1"], ["am2"], ["am3"]]
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<UpstreamError /><UpstreamError /><AlertGrid />");
|
||||
@@ -68,7 +71,8 @@ describe("<Grid />", () => {
|
||||
alertStore.status.error = "error";
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 0, healthy: 0, failed: 1 },
|
||||
instances: [{ name: "am", uri: "http://am1", error: "error" }]
|
||||
instances: [{ name: "am", uri: "http://am1", error: "error" }],
|
||||
clusters: [["am"]]
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<FatalError />");
|
||||
|
||||
Reference in New Issue
Block a user