From 48f9176cf9593404c47ba9bb90e160f6136a233d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 2 Sep 2018 19:02:23 +0100 Subject: [PATCH] fix(tests): add missing coverage cases for AlertManagerInput --- ui/src/Components/SilenceModal/AlertManagerInput.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/src/Components/SilenceModal/AlertManagerInput.test.js b/ui/src/Components/SilenceModal/AlertManagerInput.test.js index 1e7257fb9..75c42bb1b 100644 --- a/ui/src/Components/SilenceModal/AlertManagerInput.test.js +++ b/ui/src/Components/SilenceModal/AlertManagerInput.test.js @@ -70,6 +70,15 @@ describe("", () => { } }); + it("doesn't override last selected Alertmanager instances on mount", () => { + silenceFormStore.data.alertmanagers = [AlertmanagerOption(1)]; + ShallowAlertManagerInput(); + expect(silenceFormStore.data.alertmanagers).toHaveLength(1); + expect(silenceFormStore.data.alertmanagers).toContainEqual( + AlertmanagerOption(1) + ); + }); + it("renders all 3 suggestions", () => { const tree = ValidateSuggestions(); const options = tree.find("[role='option']");