From cad1da7eba7af79b0cfb82872fc31a93ee395f64 Mon Sep 17 00:00:00 2001 From: hideokamoto Date: Sun, 3 Dec 2017 11:35:42 -0600 Subject: [PATCH 1/3] make component unit test for component/panel/color.js --- .../panel/test/__snapshots__/color.js.snap | 23 +++++++++++++++++++ components/panel/test/color.js | 16 +++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 components/panel/test/__snapshots__/color.js.snap create mode 100644 components/panel/test/color.js diff --git a/components/panel/test/__snapshots__/color.js.snap b/components/panel/test/__snapshots__/color.js.snap new file mode 100644 index 00000000000000..312c86bc2e6c1d --- /dev/null +++ b/components/panel/test/__snapshots__/color.js.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PanelColor should match snapshot 1`] = ` + + sample title + , + , + ] + } +/> +`; diff --git a/components/panel/test/color.js b/components/panel/test/color.js new file mode 100644 index 00000000000000..ad73c3cfa094cb --- /dev/null +++ b/components/panel/test/color.js @@ -0,0 +1,16 @@ +/** + * External dependencies + */ +import { shallow } from 'enzyme'; + +/** + * Internal dependencies + */ +import PanelColor from '../color'; + +describe( 'PanelColor', () => { + it( 'should match snapshot', () => { + const wrapper = shallow( ); + expect( wrapper ).toMatchSnapshot(); + } ); +} ); From a6e9dc98e7acb7c3873795436080eeabd3e7bb64 Mon Sep 17 00:00:00 2001 From: hideokamoto Date: Sun, 3 Dec 2017 11:39:04 -0600 Subject: [PATCH 2/3] add snapshot test for PanelColor --- .../panel/test/__snapshots__/color.js.snap | 20 +++++++++++++++++++ components/panel/test/color.js | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/components/panel/test/__snapshots__/color.js.snap b/components/panel/test/__snapshots__/color.js.snap index 312c86bc2e6c1d..557f510c5e5cc5 100644 --- a/components/panel/test/__snapshots__/color.js.snap +++ b/components/panel/test/__snapshots__/color.js.snap @@ -21,3 +21,23 @@ exports[`PanelColor should match snapshot 1`] = ` } /> `; + +exports[`PanelColor should match snapshot when colorValue is empty 1`] = ` +, + , + ] + } +/> +`; diff --git a/components/panel/test/color.js b/components/panel/test/color.js index ad73c3cfa094cb..ce1f704ce9d24b 100644 --- a/components/panel/test/color.js +++ b/components/panel/test/color.js @@ -13,4 +13,8 @@ describe( 'PanelColor', () => { const wrapper = shallow( ); expect( wrapper ).toMatchSnapshot(); } ); + it( 'should match snapshot when title is empty', () => { + const wrapper = shallow( ); + expect( wrapper ).toMatchSnapshot(); + } ); } ); From fafde735042085112836eb9fd2880d93a824ce55 Mon Sep 17 00:00:00 2001 From: hideokamoto Date: Sun, 3 Dec 2017 11:40:26 -0600 Subject: [PATCH 3/3] fix snapshot of PanelRow component --- components/panel/test/__snapshots__/color.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/panel/test/__snapshots__/color.js.snap b/components/panel/test/__snapshots__/color.js.snap index 557f510c5e5cc5..7a523fb33732eb 100644 --- a/components/panel/test/__snapshots__/color.js.snap +++ b/components/panel/test/__snapshots__/color.js.snap @@ -22,7 +22,7 @@ exports[`PanelColor should match snapshot 1`] = ` /> `; -exports[`PanelColor should match snapshot when colorValue is empty 1`] = ` +exports[`PanelColor should match snapshot when title is empty 1`] = `