From 2ee69f9c0862a4b54f5cddb6fd7de7a8f8c79d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 2 Sep 2018 18:09:46 +0100 Subject: [PATCH] fix(tests): add missing HistoryLabels tests --- .../Labels/HistoryLabel/index.test.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ui/src/Components/Labels/HistoryLabel/index.test.js 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"); + }); +});