feat(ui): add @cluster to multi-grid label dropdown

This commit is contained in:
Łukasz Mierzwa
2020-06-12 10:45:58 +01:00
committed by Łukasz Mierzwa
parent 172d0d9257
commit 9f15ffef35
2 changed files with 5 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ const valueToOption = (v) => ({ label: v ? v : disabledLabel, value: v });
const staticValues = [
{ label: disabledLabel, value: "" },
{ label: "@alertmanager", value: "@alertmanager" },
{ label: "@cluster", value: "@cluster" },
{ label: "@receiver", value: "@receiver" },
];

View File

@@ -72,16 +72,17 @@ describe("<MultiGridConfiguration />", () => {
});
const tree = ExpandSortLabelSuggestions();
const options = tree.find("div.react-select__option");
expect(options).toHaveLength(3);
expect(options).toHaveLength(4);
expect(options.at(0).text()).toBe("Disable multi-grid");
expect(options.at(1).text()).toBe("@alertmanager");
expect(options.at(2).text()).toBe("@receiver");
expect(options.at(2).text()).toBe("@cluster");
expect(options.at(3).text()).toBe("@receiver");
});
it("clicking on a label option updates settingsStore", () => {
const tree = ExpandSortLabelSuggestions();
const options = tree.find("div.react-select__option");
options.at(4).simulate("click");
options.at(5).simulate("click");
expect(settingsStore.multiGridConfig.config.gridLabel).toBe("job");
});