{text}
@@ -28,7 +26,7 @@ const Accordion = ({ text, content, extraProps }) => (
className="card"
openedClassName="card"
triggerClassName="card-header cursor-pointer border-bottom-0"
- triggerOpenedClassName="card-header cursor-pointer bg-light"
+ triggerOpenedClassName="card-header cursor-pointer"
contentOuterClassName="collapse show"
contentInnerClassName="card-body my-2"
{...extraProps}
diff --git a/ui/src/Components/Accordion/index.scss b/ui/src/Components/Accordion/index.scss
deleted file mode 100644
index 5bd4b051e..000000000
--- a/ui/src/Components/Accordion/index.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.accordion > .Collapsible.card {
- overflow: unset;
-}
diff --git a/ui/src/Components/AlertAck/index.test.js b/ui/src/Components/AlertAck/index.test.js
index b36a4bf2f..9512f7dd8 100644
--- a/ui/src/Components/AlertAck/index.test.js
+++ b/ui/src/Components/AlertAck/index.test.js
@@ -2,6 +2,8 @@ import React from "react";
import { mount } from "enzyme";
+import toDiffableHtml from "diffable-html";
+
import { advanceTo, clear } from "jest-date-mock";
import { MockAlertGroup, MockAlert } from "__mocks__/Alerts.js";
@@ -85,7 +87,7 @@ describe("
", () => {
it("uses faCheck icon when idle", () => {
const tree = MountedAlertAck();
- expect(tree.html()).toMatch(/fa-check/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-check/);
});
it("uses faExclamationCircle after failed fetch", async () => {
@@ -96,7 +98,7 @@ describe("
", () => {
await expect(
tree.instance().submitState.silencesByCluster["default"].fetch
).resolves.toBeUndefined();
- expect(tree.html()).toMatch(/fa-exclamation-circle/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-exclamation-circle/);
});
it("[v1] uses faCheckCircle after successful fetch", async () => {
@@ -109,7 +111,7 @@ describe("
", () => {
await expect(
tree.instance().submitState.silencesByCluster["default"].fetch
).resolves.toBeUndefined();
- expect(tree.html()).toMatch(/fa-check-circle/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-check-circle/);
});
it("[v2] uses faCheckCircle after successful fetch", async () => {
@@ -121,7 +123,7 @@ describe("
", () => {
await expect(
tree.instance().submitState.silencesByCluster["default"].fetch
).resolves.toBeUndefined();
- expect(tree.html()).toMatch(/fa-check-circle/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-check-circle/);
});
it("sends a request on click", () => {
diff --git a/ui/src/Components/Animations/DropdownSlide/index.js b/ui/src/Components/Animations/DropdownSlide/index.js
index 5275644c0..f2b72a474 100644
--- a/ui/src/Components/Animations/DropdownSlide/index.js
+++ b/ui/src/Components/Animations/DropdownSlide/index.js
@@ -3,8 +3,6 @@ import PropTypes from "prop-types";
import { CSSTransition } from "react-transition-group";
-import "./index.css";
-
const DropdownSlide = ({ children, duration, ...props }) => (
(
(
(
matches snapshot when inhibited 1`] = `
"
-
+
matches snapshot when inhibited 1`] = `
exports[`
matches snapshot with showAlertmanagers=false showReceiver=false 1`] = `
"
-
+
", () => {
it("contains value when visible=true", () => {
const tree = ShallowNonLinkAnnotation(true);
- expect(tree.html()).toMatch(/some long text/);
+ expect(toDiffableHtml(tree.html())).toMatch(/some long text/);
});
it("matches snapshot when visible=false", () => {
@@ -89,7 +89,7 @@ describe("
", () => {
it("doesn't contain value when visible=false", () => {
const tree = ShallowNonLinkAnnotation(false);
- expect(tree.html()).not.toMatch(/some long text/);
+ expect(toDiffableHtml(tree.html())).not.toMatch(/some long text/);
});
it("links inside annotation are rendered as a.href", () => {
@@ -100,19 +100,19 @@ describe("
", () => {
it("clicking on - icon hides the value", () => {
const tree = MountedNonLinkAnnotation(true);
- expect(tree.html()).toMatch(/fa-search-minus/);
- expect(tree.html()).toMatch(/some long text/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-search-minus/);
+ expect(toDiffableHtml(tree.html())).toMatch(/some long text/);
tree.find(".fa-search-minus").simulate("click");
- expect(tree.html()).toMatch(/fa-search-plus/);
- expect(tree.html()).not.toMatch(/some long text/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-search-plus/);
+ expect(toDiffableHtml(tree.html())).not.toMatch(/some long text/);
});
it("clicking on + icon shows the value", () => {
const tree = MountedNonLinkAnnotation(false);
- expect(tree.html()).toMatch(/fa-search-plus/);
- expect(tree.html()).not.toMatch(/some long text/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-search-plus/);
+ expect(toDiffableHtml(tree.html())).not.toMatch(/some long text/);
tree.find(".components-grid-annotation").simulate("click");
- expect(tree.html()).toMatch(/fa-search-minus/);
- expect(tree.html()).toMatch(/some long text/);
+ expect(toDiffableHtml(tree.html())).toMatch(/fa-search-minus/);
+ expect(toDiffableHtml(tree.html())).toMatch(/some long text/);
});
});
diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap
index 077095c38..ae7faf160 100644
--- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap
+++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap
@@ -2,7 +2,7 @@
exports[`
matches snapshot 1`] = `
"
-