", () => {
it("renders all 3 suggestions", () => {
const tree = ValidateSuggestions();
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
expect(options).toHaveLength(2);
expect(options.at(0).text()).toBe("am1 | am2");
expect(options.at(1).text()).toBe("am3");
@@ -134,7 +134,7 @@ describe("
", () => {
it("clicking on options appends them to silenceFormStore.data.alertmanagers", () => {
silenceFormStore.data.alertmanagers = [];
const tree = ValidateSuggestions();
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
options.at(0).simulate("click");
options.at(1).simulate("click");
expect(silenceFormStore.data.alertmanagers).toHaveLength(2);
diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.js b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.js
index 4b7677456..ad58c2d24 100644
--- a/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.js
+++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.test.js
@@ -72,7 +72,7 @@ describe("
", () => {
it("renders suggestions", () => {
const tree = ValidateSuggestions();
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
expect(options).toHaveLength(2);
expect(options.at(0).text()).toBe("job");
expect(options.at(1).text()).toBe("cluster");
@@ -80,7 +80,7 @@ describe("
", () => {
it("clicking on options updates the matcher", () => {
const tree = ValidateSuggestions();
- const option = tree.find(".react-select__option").at(0);
+ const option = tree.find("div.react-select__option").at(0);
option.simulate("click");
expect(matcher.name).toBe("job");
});
diff --git a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.js b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.js
index 00a529816..a0a58797d 100644
--- a/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.js
+++ b/ui/src/Components/SilenceModal/SilenceMatch/LabelValueInput.test.js
@@ -84,7 +84,7 @@ describe("
", () => {
it("renders suggestions", () => {
const tree = ValidateSuggestions();
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
expect(options).toHaveLength(2);
expect(options.at(0).text()).toBe("foo");
expect(options.at(1).text()).toBe("bar");
@@ -92,7 +92,7 @@ describe("
", () => {
it("clicking on options appends them to matcher.values", () => {
const tree = ValidateSuggestions();
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
options.at(0).simulate("click");
options.at(1).simulate("click");
expect(matcher.values).toHaveLength(2);
@@ -103,7 +103,7 @@ describe("
", () => {
it("selecting one option doesn't force matcher.isRegex=true", () => {
const tree = ValidateSuggestions();
expect(matcher.isRegex).toBe(false);
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
options.at(0).simulate("click");
expect(matcher.isRegex).toBe(false);
});
@@ -112,7 +112,7 @@ describe("
", () => {
matcher.isRegex = true;
const tree = ValidateSuggestions();
expect(matcher.isRegex).toBe(true);
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
options.at(0).simulate("click");
expect(matcher.isRegex).toBe(false);
});
@@ -120,7 +120,7 @@ describe("
", () => {
it("selecting multiple options forces matcher.isRegex=true", () => {
const tree = ValidateSuggestions();
expect(matcher.isRegex).toBe(false);
- const options = tree.find(".react-select__option");
+ const options = tree.find("div.react-select__option");
options.at(0).simulate("click");
options.at(1).simulate("click");
expect(matcher.isRegex).toBe(true);
diff --git a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.js.snap b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.js.snap
index 42aa7b30d..f8ad0314e 100644
--- a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.js.snap
+++ b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelNameInput.test.js.snap
@@ -2,10 +2,10 @@
exports[`
matches snapshot 1`] = `
"
-
-
-
-
+
+
+
+
name
@@ -28,11 +28,11 @@ exports[` matches snapshot 1`] = `
-
-
+
+
matches snapshot 1`] = `
"
-
-
-
+
+
+
-
@@ -53,11 +53,11 @@ exports[`
matches snapshot 1`] = `
-