mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
chore(ui): update UI to consume cluster list as a dict
This commit is contained in:
@@ -69,7 +69,7 @@ beforeEach(() => {
|
||||
clusterMembers: ["default"]
|
||||
}
|
||||
],
|
||||
clusters: [["default"]]
|
||||
clusters: { default: ["default"] }
|
||||
};
|
||||
alertStore.data.silences = {
|
||||
default: {
|
||||
|
||||
@@ -102,7 +102,7 @@ const AlertGrid = observer(
|
||||
key={id}
|
||||
group={alertStore.data.groups[id]}
|
||||
showAlertmanagers={
|
||||
alertStore.data.upstreams.clusters.length > 1
|
||||
Object.keys(alertStore.data.upstreams.clusters).length > 1
|
||||
}
|
||||
afterUpdate={this.masonryRepack}
|
||||
settingsStore={settingsStore}
|
||||
|
||||
@@ -59,7 +59,7 @@ const MockGroupList = count => {
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 0, healthy: 1, failed: 0 },
|
||||
instances: [{ name: "am", uri: "http://am", error: "" }],
|
||||
clusters: [["am"]]
|
||||
clusters: { am: ["am"] }
|
||||
};
|
||||
alertStore.data.groups = groups;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ describe("<Grid />", () => {
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 1, healthy: 0, failed: 1 },
|
||||
instances: [{ name: "am1", uri: "http://am1", error: "error" }],
|
||||
clusters: [["am1"]]
|
||||
clusters: { am1: ["am1"] }
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<FatalError />");
|
||||
@@ -47,7 +47,7 @@ describe("<Grid />", () => {
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 1, healthy: 0, failed: 1 },
|
||||
instances: [{ name: "am1", uri: "http://am1", error: "" }],
|
||||
clusters: [["am1"]]
|
||||
clusters: { am1: ["am1"] }
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<AlertGrid />");
|
||||
@@ -61,7 +61,7 @@ describe("<Grid />", () => {
|
||||
{ name: "am2", uri: "file:///mock", error: "" },
|
||||
{ name: "am3", uri: "http://am1", error: "error 2" }
|
||||
],
|
||||
clusters: [["am1"], ["am2"], ["am3"]]
|
||||
clusters: { am1: ["am1"], am2: ["am2"], am3: ["am3"] }
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<UpstreamError /><UpstreamError /><AlertGrid />");
|
||||
@@ -72,7 +72,7 @@ describe("<Grid />", () => {
|
||||
alertStore.data.upstreams = {
|
||||
counters: { total: 0, healthy: 0, failed: 1 },
|
||||
instances: [{ name: "am", uri: "http://am1", error: "error" }],
|
||||
clusters: [["am"]]
|
||||
clusters: { am1: ["am1"] }
|
||||
};
|
||||
const tree = ShallowGrid();
|
||||
expect(tree.text()).toBe("<FatalError />");
|
||||
|
||||
Reference in New Issue
Block a user