From 9bfd837390514e06546dee84d2258d5342365ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20=28Greg=29=20Zi=C3=B3=C5=82kowski?= Date: Mon, 4 Dec 2017 15:15:59 +0100 Subject: [PATCH] Tests: Update PanelColor component unit tests (#3797) --- .../panel/test/__snapshots__/color.js.snap | 31 ++----------------- components/panel/test/color.js | 15 ++++++--- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/components/panel/test/__snapshots__/color.js.snap b/components/panel/test/__snapshots__/color.js.snap index 7a523fb33732e..72aaaa9d6c402 100644 --- a/components/panel/test/__snapshots__/color.js.snap +++ b/components/panel/test/__snapshots__/color.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PanelColor should match snapshot 1`] = ` +exports[`PanelColor should match snapshot when title is provided 1`] = ` sample title , - , - ] - } -/> -`; - -exports[`PanelColor should match snapshot when title is empty 1`] = ` -, - , + undefined, ] } /> diff --git a/components/panel/test/color.js b/components/panel/test/color.js index ce1f704ce9d24..f0ad605b6823f 100644 --- a/components/panel/test/color.js +++ b/components/panel/test/color.js @@ -9,12 +9,17 @@ import { shallow } from 'enzyme'; import PanelColor from '../color'; describe( 'PanelColor', () => { - it( 'should match snapshot', () => { - const wrapper = shallow( ); + it( 'should match snapshot when title is provided', () => { + const wrapper = shallow( ); + expect( wrapper ).toMatchSnapshot(); } ); - it( 'should match snapshot when title is empty', () => { - const wrapper = shallow( ); - expect( wrapper ).toMatchSnapshot(); + + it( 'should have color when provided', () => { + const wrapper = shallow( ); + + expect( wrapper.prop( 'title' ) ).toContainEqual( + + ); } ); } );