-
+"
`;
diff --git a/ui/src/Components/NavBar/FilterInput/index.test.js b/ui/src/Components/NavBar/FilterInput/index.test.js
index 8468f041c..0f7ca2c45 100644
--- a/ui/src/Components/NavBar/FilterInput/index.test.js
+++ b/ui/src/Components/NavBar/FilterInput/index.test.js
@@ -2,6 +2,8 @@ import React from "react";
import { mount, render } from "enzyme";
+import toDiffableHtml from "diffable-html";
+
import { AlertStore, NewUnappliedFilter } from "Stores/AlertStore";
import { Settings } from "Stores/Settings";
import { FilterInput } from ".";
@@ -33,7 +35,7 @@ describe("
", () => {
const tree = render(
);
- expect(tree).toMatchSnapshot();
+ expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
it("inputStore.ref should be != null after mount", () => {
diff --git a/ui/src/Components/SilenceModal/AlertManagerInput.test.js b/ui/src/Components/SilenceModal/AlertManagerInput.test.js
index ca863bbf9..71e1fc883 100644
--- a/ui/src/Components/SilenceModal/AlertManagerInput.test.js
+++ b/ui/src/Components/SilenceModal/AlertManagerInput.test.js
@@ -2,6 +2,8 @@ import React from "react";
import { shallow, mount } from "enzyme";
+import toDiffableHtml from "diffable-html";
+
import { AlertStore } from "Stores/AlertStore";
import { SilenceFormStore } from "Stores/SilenceFormStore";
import { AlertManagerInput } from "./AlertManagerInput";
@@ -57,7 +59,7 @@ const ValidateSuggestions = () => {
describe("
", () => {
it("matches snapshot", () => {
const tree = ShallowAlertManagerInput();
- expect(tree).toMatchSnapshot();
+ expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
it("doesn't render ValidationError after passed validation", () => {
diff --git a/ui/src/Components/SilenceModal/LabelNameInput.js b/ui/src/Components/SilenceModal/LabelNameInput.js
index bedb21361..21f8c7b99 100644
--- a/ui/src/Components/SilenceModal/LabelNameInput.js
+++ b/ui/src/Components/SilenceModal/LabelNameInput.js
@@ -94,7 +94,8 @@ const LabelNameInput = observer(
defaultValue: value,
options: matcher.suggestions.names,
placeholder: isValid ? "Label name" :
,
- onChange: this.onChange
+ onChange: this.onChange,
+ hideSelectedOptions: true
};
};
}
diff --git a/ui/src/Components/SilenceModal/LabelNameInput.test.js b/ui/src/Components/SilenceModal/LabelNameInput.test.js
index 857de24b1..1e37739a9 100644
--- a/ui/src/Components/SilenceModal/LabelNameInput.test.js
+++ b/ui/src/Components/SilenceModal/LabelNameInput.test.js
@@ -2,6 +2,8 @@ import React from "react";
import { shallow, mount } from "enzyme";
+import toDiffableHtml from "diffable-html";
+
import { NewEmptyMatcher, MatcherValueToObject } from "Stores/SilenceFormStore";
import { LabelNameInput } from "./LabelNameInput";
@@ -43,7 +45,7 @@ const ValidateSuggestions = () => {
describe("
", () => {
it("matches snapshot", () => {
const tree = ShallowLabelNameInput(true);
- expect(tree).toMatchSnapshot();
+ expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
it("doesn't renders ValidationError after passed validation", () => {
diff --git a/ui/src/Components/SilenceModal/LabelValueInput.test.js b/ui/src/Components/SilenceModal/LabelValueInput.test.js
index c4699c357..bf6f76bc5 100644
--- a/ui/src/Components/SilenceModal/LabelValueInput.test.js
+++ b/ui/src/Components/SilenceModal/LabelValueInput.test.js
@@ -2,6 +2,8 @@ import React from "react";
import { shallow, mount } from "enzyme";
+import toDiffableHtml from "diffable-html";
+
import { NewEmptyMatcher, MatcherValueToObject } from "Stores/SilenceFormStore";
import { LabelValueInput } from "./LabelValueInput";
@@ -39,7 +41,7 @@ const ValidateSuggestions = () => {
describe("
", () => {
it("matches snapshot", () => {
const tree = ShallowLabelValueInput(true);
- expect(tree).toMatchSnapshot();
+ expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
it("doesn't renders ValidationError after passed validation", () => {
diff --git a/ui/src/Components/SilenceModal/SilencePreview.test.js b/ui/src/Components/SilenceModal/SilencePreview.test.js
index 43be7a081..44d0e0036 100644
--- a/ui/src/Components/SilenceModal/SilencePreview.test.js
+++ b/ui/src/Components/SilenceModal/SilencePreview.test.js
@@ -2,6 +2,8 @@ import React from "react";
import { render } from "enzyme";
+import toDiffableHtml from "diffable-html";
+
import moment from "moment";
import { SilenceFormStore } from "Stores/SilenceFormStore";
@@ -16,6 +18,6 @@ describe("
", () => {
silenceFormStore.data.comment = "SilencePreview test";
const tree = render(
);
- expect(tree).toMatchSnapshot();
+ expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
});
diff --git a/ui/src/Components/SilenceModal/__snapshots__/AlertManagerInput.test.js.snap b/ui/src/Components/SilenceModal/__snapshots__/AlertManagerInput.test.js.snap
index 50da3b856..fb8de53da 100644
--- a/ui/src/Components/SilenceModal/__snapshots__/AlertManagerInput.test.js.snap
+++ b/ui/src/Components/SilenceModal/__snapshots__/AlertManagerInput.test.js.snap
@@ -1,154 +1,114 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`
matches snapshot 1`] = `
-
false,
- "nodeType" => false,
- "$$typeof" => false,
- "@@__IMMUTABLE_LIST__@@" => false,
- "@@__IMMUTABLE_SET__@@" => false,
- "@@__IMMUTABLE_MAP__@@" => false,
- "@@__IMMUTABLE_STACK__@@" => false,
- "toJSON" => false,
- },
- "proxy": [Circular],
- "target": Object {
- "label": "am1",
- "value": "http://am1.example.com",
- Symbol(mobx administration): [Circular],
- },
- "values": Map {
- "label" => "am1",
- "value" => "http://am1.example.com",
- },
- },
- },
- Object {
- "label": "am2",
- "value": "http://am2.example.com",
- Symbol(mobx administration): ObservableObjectAdministration$$1 {
- "defaultEnhancer": [Function],
- "keysAtom": Atom$$1 {
- "diffValue": 0,
- "isBeingObserved": false,
- "isPendingUnobservation": false,
- "lastAccessedBy": 0,
- "lowestObserverState": 2,
- "name": "Silence form store.alertmanagers[..].keys",
- "observers": Set {},
- },
- "name": "Silence form store.alertmanagers[..]",
- "pendingKeys": Map {
- "cheerio" => false,
- "nodeType" => false,
- "$$typeof" => false,
- "@@__IMMUTABLE_LIST__@@" => false,
- "@@__IMMUTABLE_SET__@@" => false,
- "@@__IMMUTABLE_MAP__@@" => false,
- "@@__IMMUTABLE_STACK__@@" => false,
- "toJSON" => false,
- },
- "proxy": [Circular],
- "target": Object {
- "label": "am2",
- "value": "http://am2.example.com",
- Symbol(mobx administration): [Circular],
- },
- "values": Map {
- "label" => "am2",
- "value" => "http://am2.example.com",
- },
- },
- },
- Object {
- "label": "am3",
- "value": "http://am3.example.com",
- Symbol(mobx administration): ObservableObjectAdministration$$1 {
- "defaultEnhancer": [Function],
- "keysAtom": Atom$$1 {
- "diffValue": 0,
- "isBeingObserved": false,
- "isPendingUnobservation": false,
- "lastAccessedBy": 0,
- "lowestObserverState": 2,
- "name": "Silence form store.alertmanagers[..].keys",
- "observers": Set {},
- },
- "name": "Silence form store.alertmanagers[..]",
- "pendingKeys": Map {
- "cheerio" => false,
- "nodeType" => false,
- "$$typeof" => false,
- "@@__IMMUTABLE_LIST__@@" => false,
- "@@__IMMUTABLE_SET__@@" => false,
- "@@__IMMUTABLE_MAP__@@" => false,
- "@@__IMMUTABLE_STACK__@@" => false,
- "toJSON" => false,
- },
- "proxy": [Circular],
- "target": Object {
- "label": "am3",
- "value": "http://am3.example.com",
- Symbol(mobx administration): [Circular],
- },
- "values": Map {
- "label" => "am3",
- "value" => "http://am3.example.com",
- },
- },
- },
- ]
- }
- instanceId="silence-input-alertmanagers"
- isMulti={true}
- onChange={[Function]}
- options={
- Array [
- Object {
- "label": "am1",
- "value": "http://am1.example.com",
- },
- Object {
- "label": "am2",
- "value": "http://am2.example.com",
- },
- Object {
- "label": "am3",
- "value": "http://am3.example.com",
- },
- ]
- }
- placeholder="Alertmanager"
- styles={
- Object {
- "control": [Function],
- "indicatorsContainer": [Function],
- "multiValue": [Function],
- "multiValueLabel": [Function],
- "multiValueRemove": [Function],
- "option": [Function],
- "valueContainer": [Function],
- }
- }
-/>
+"
+
+"
`;
diff --git a/ui/src/Components/SilenceModal/__snapshots__/LabelNameInput.test.js.snap b/ui/src/Components/SilenceModal/__snapshots__/LabelNameInput.test.js.snap
index 332b0ac3d..aa5760c6d 100644
--- a/ui/src/Components/SilenceModal/__snapshots__/LabelNameInput.test.js.snap
+++ b/ui/src/Components/SilenceModal/__snapshots__/LabelNameInput.test.js.snap
@@ -1,40 +1,52 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[` matches snapshot 1`] = `
-
+"
+
+"
`;
diff --git a/ui/src/Components/SilenceModal/__snapshots__/LabelValueInput.test.js.snap b/ui/src/Components/SilenceModal/__snapshots__/LabelValueInput.test.js.snap
index 269f13542..81cf1c7b5 100644
--- a/ui/src/Components/SilenceModal/__snapshots__/LabelValueInput.test.js.snap
+++ b/ui/src/Components/SilenceModal/__snapshots__/LabelValueInput.test.js.snap
@@ -1,36 +1,52 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[` matches snapshot 1`] = `
-
+"
+
+"
`;
diff --git a/ui/src/Components/SilenceModal/__snapshots__/SilencePreview.test.js.snap b/ui/src/Components/SilenceModal/__snapshots__/SilencePreview.test.js.snap
index d884d9fff..5a8cdc11d 100644
--- a/ui/src/Components/SilenceModal/__snapshots__/SilencePreview.test.js.snap
+++ b/ui/src/Components/SilenceModal/__snapshots__/SilencePreview.test.js.snap
@@ -1,73 +1,50 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[` matches snapshot 1`] = `
-
-
- {
- "
-
- matchers
-
- ": [],
- "
-
- startsAt
-
- ":
-
- "2000-02-01T00:00:00.000Z"
-
- ,
- "
-
- endsAt
-
- ":
-
- "2000-02-01T01:00:00.000Z"
-
- ,
- "
-
- createdBy
-
- ":
-
- ""
-
- ,
- "
-
- comment
-
- ":
-
- "SilencePreview test"
-
-
- }
-
-
+"
+
+ {
+ "
+
+ matchers
+
+ ": [],
+ "
+
+ startsAt
+
+ ":
+
+ "2000-02-01T00:00:00.000Z"
+
+ ,
+ "
+
+ endsAt
+
+ ":
+
+ "2000-02-01T01:00:00.000Z"
+
+ ,
+ "
+
+ createdBy
+
+ ":
+
+ ""
+
+ ,
+ "
+
+ comment
+
+ ":
+
+ "SilencePreview test"
+
+ }
+
+"
`;