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 new file mode 100644 index 000000000..503472efe --- /dev/null +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` matches snapshot 1`] = ` +" + +" +`; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.test.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.test.js new file mode 100644 index 000000000..c4d39ea2b --- /dev/null +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/index.test.js @@ -0,0 +1,54 @@ +import React from "react"; + +import { Provider } from "mobx-react"; + +import { mount } from "enzyme"; + +import toDiffableHtml from "diffable-html"; + +import { MockAlertGroup, MockAnnotation } from "__mocks__/Alerts.js"; +import { AlertStore } from "Stores/AlertStore"; +import { GroupFooter } from "."; + +let group; +let alertStore; + +const MockGroup = () => { + const group = MockAlertGroup( + { alertname: "Fake Alert" }, + [], + [ + MockAnnotation("summary", "This is summary", true, false), + MockAnnotation("hidden", "This is hidden annotation", false, false), + MockAnnotation("link", "http://link.example.com", true, true) + ], + { label1: "foo", label2: "bar" } + ); + return group; +}; + +const MockAfterUpdate = jest.fn(); + +beforeEach(() => { + alertStore = new AlertStore([]); + group = MockGroup(); +}); + +const MountedGroupFooter = () => { + return mount( + + + + ); +}; + +describe("", () => { + it("matches snapshot", () => { + const tree = MountedGroupFooter().find("GroupFooter"); + expect(toDiffableHtml(tree.html())).toMatchSnapshot(); + }); +});