From 4100486127a203e592df7876163304afbd359830 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?=
Date: Fri, 15 Feb 2019 09:51:19 +0000
Subject: [PATCH] fix(tests): add css classes to react-select components
react-select 2.4 drops role['option'] from Option components, which makes it harder to find those in the DOM while testing. Set classNamePrefix so that all components get extra react-select-* css classes, which allows to easily reference them in tests via enzyme selectors.
---
.../__snapshots__/index.test.js.snap | 92 +++++++++----------
ui/src/Components/MultiSelect/index.js | 6 +-
.../__snapshots__/index.test.js.snap | 26 +++---
.../SilenceModal/AlertManagerInput/index.js | 1 +
.../AlertManagerInput/index.test.js | 4 +-
.../SilenceMatch/LabelNameInput.test.js | 4 +-
.../SilenceMatch/LabelValueInput.test.js | 10 +-
.../__snapshots__/LabelNameInput.test.js.snap | 14 +--
.../LabelValueInput.test.js.snap | 14 +--
9 files changed, 88 insertions(+), 83 deletions(-)
diff --git a/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap b/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap
index e2c48f041..19080c22e 100644
--- a/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap
+++ b/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap
@@ -13,13 +13,13 @@ exports[` matches snapshot when focused 1`] = `
0 results available. Select is focused ,type to refine list, press Down to open the menu,
-
-
-
+
+
+
Select...
-
matches snapshot when focused 1`] = `
-
-
+
+
matches snapshot when focused 1`] = `
exports[` matches snapshot with a value 1`] = `
"
-
-
-
+
+
+
foo
-
matches snapshot with a value 1`] = `
-
-
+
+
matches snapshot with a value 1`] = `
exports[` matches snapshot with defaults 1`] = `
"
-
-
-
+
+
+
Select...
-
matches snapshot with defaults 1`] = `
-
-
+
+
matches snapshot with defaults 1`] = `
exports[` matches snapshot with isDisabled=true 1`] = `
"
-
-
-
-
+
+
+
+
foo
-
matches snapshot with isDisabled=true 1`] = `
-
-
+
+
matches snapshot with isDisabled=true 1`] = `
exports[` matches snapshot with isMulti=true 1`] = `
"
-
-
-
+
+
+
Select...
-
matches snapshot with isMulti=true 1`] = `
-
-
+
+
matches snapshot with isMulti=true 1`] = `
exports[` matches snapshot with isMulti=true and a value 1`] = `
"