diff --git a/ui/src/Components/Labels/HistoryLabel/index.test.js b/ui/src/Components/Labels/HistoryLabel/index.test.js new file mode 100644 index 000000000..fb64c67ae --- /dev/null +++ b/ui/src/Components/Labels/HistoryLabel/index.test.js @@ -0,0 +1,34 @@ +import React from "react"; + +import { shallow } from "enzyme"; + +import { AlertStore } from "Stores/AlertStore"; + +import { HistoryLabel } from "."; + +let alertStore; + +beforeEach(() => { + alertStore = new AlertStore([]); +}); + +describe("", () => { + it("renders name, matcher and value if all are set", () => { + const tree = shallow( + + ); + expect(tree.text()).toBe("foo=bar"); + }); + + it("renders only value if name is falsey", () => { + const tree = shallow( + + ); + expect(tree.text()).toBe("bar"); + }); +});