From 9f15ffef356ea43830cde97eb1504adab2460bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Fri, 12 Jun 2020 10:45:58 +0100 Subject: [PATCH] feat(ui): add @cluster to multi-grid label dropdown --- ui/src/Components/MainModal/Configuration/GridLabelName.js | 1 + .../MainModal/Configuration/MultiGridConfiguration.test.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/src/Components/MainModal/Configuration/GridLabelName.js b/ui/src/Components/MainModal/Configuration/GridLabelName.js index 4183f3de9..683132ad0 100644 --- a/ui/src/Components/MainModal/Configuration/GridLabelName.js +++ b/ui/src/Components/MainModal/Configuration/GridLabelName.js @@ -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" }, ]; diff --git a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.js b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.js index a1202510a..27814dac6 100644 --- a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.js +++ b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.test.js @@ -72,16 +72,17 @@ describe("", () => { }); 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"); });