From eac502df498ee8bc6b97d12c33121c9b6b03077b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 30 Aug 2018 22:53:57 +0100 Subject: [PATCH] fix(tests): add missing MultiSelect coverage --- .../__snapshots__/index.test.js.snap | 863 ++++++++++++++++++ ui/src/Components/MultiSelect/index.test.js | 16 +- 2 files changed, 878 insertions(+), 1 deletion(-) diff --git a/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap b/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap index 90a223121..318800f69 100644 --- a/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap +++ b/ui/src/Components/MultiSelect/__snapshots__/index.test.js.snap @@ -1,5 +1,868 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[` matches snapshot when focused 1`] = ` + + + + +
+ +
+ +
+
+ +
+ +
+ + +
+ + + + + + +
+
+ + + + + +
+
+
+`; + exports[` matches snapshot with a value 1`] = ` ({ label: value, value: value }); +describe("", () => { + it("renders without any extra props", () => { + const tree = shallow(); + expect(tree.text()).toBe(""); + }); +}); + class CustomMultiSelect extends MultiSelect { constructor(props) { super(props); @@ -26,6 +33,13 @@ describe("", () => { expect(tree).toMatchSnapshot(); }); + it("matches snapshot when focused", () => { + // this test is to cover styles state.isFocused conditions + const tree = mount(); + tree.find("input").simulate("focus"); + expect(tree).toMatchSnapshot(); + }); + it("matches snapshot with a value", () => { const tree = shallow(