From 3839d531e486e54a2aad14f792d37a198d21ac9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 30 May 2019 23:08:13 +0100 Subject: [PATCH] fix(ui): allow any string as silence author, not just email Alertmanager doesn't restrict this field, so no need to force an email there. Fixes #741 --- ui/src/Components/SilenceModal/SilenceForm.js | 4 ++-- ui/src/Components/SilenceModal/SilenceForm.test.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/src/Components/SilenceModal/SilenceForm.js b/ui/src/Components/SilenceModal/SilenceForm.js index 20069dc87..afded9f01 100644 --- a/ui/src/Components/SilenceModal/SilenceForm.js +++ b/ui/src/Components/SilenceModal/SilenceForm.js @@ -162,9 +162,9 @@ const SilenceForm = observer( inputs", () => { it("default author value comes from Settings store", () => { settingsStore.silenceFormConfig.config.author = "foo@example.com"; const tree = MountedSilenceForm(); - const input = tree.find("input[placeholder='Author email']"); + const input = tree.find("input[placeholder='Author']"); expect(input.props().value).toBe("foo@example.com"); expect(silenceFormStore.data.author).toBe("foo@example.com"); }); @@ -135,14 +135,14 @@ describe(" inputs", () => { it("default author value is empty if nothing is stored in Settings", () => { settingsStore.silenceFormConfig.config.author = ""; const tree = MountedSilenceForm(); - const input = tree.find("input[placeholder='Author email']"); + const input = tree.find("input[placeholder='Author']"); expect(input.text()).toBe(""); expect(silenceFormStore.data.author).toBe(""); }); it("changing author input updates SilenceFormStore", () => { const tree = MountedSilenceForm(); - const input = tree.find("input[placeholder='Author email']"); + const input = tree.find("input[placeholder='Author']"); input.simulate("change", { target: { value: "me@example.com" } }); expect(silenceFormStore.data.author).toBe("me@example.com"); });