From 043fef5a00c722afc785321002cf0f7ab9467ae9 Mon Sep 17 00:00:00 2001 From: Swiip Date: Thu, 28 Mar 2019 15:35:21 +0100 Subject: [PATCH] :white_check_mark: Add test to ensure direct props to the component shallowed are used --- .../component-test-utils-react/src/shallow.spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/component-test-utils-react/src/shallow.spec.js b/packages/component-test-utils-react/src/shallow.spec.js index b3c82fe..e87f538 100644 --- a/packages/component-test-utils-react/src/shallow.spec.js +++ b/packages/component-test-utils-react/src/shallow.spec.js @@ -33,6 +33,16 @@ describe('react shallow render', () => { expect(cmp.html()).toBe(''); }); + it('it should render component with props', () => { + const Component = ({message}) => { + return

Hello {message}

; + }; + + const cmp = shallow(); + + expect(cmp.html()).toBe('

Hello test world

'); + }); + it('it should render Component but should mock ChildComponent', () => { const ChildComponent = () => { return ;