From 843ba97ae2b21be211cecd51416006115fd11ae7 Mon Sep 17 00:00:00 2001 From: Darren Ethier Date: Fri, 13 Jul 2018 03:11:48 -0400 Subject: [PATCH] Convert snapshots to use react-test-renderer/shallow (core-blocks/more/test/edit.js) (#7756) * convert snapshots to use react-test-renderer/shallow Note: with react-test-renderer, the current version of the jest pretty-format module does not handle pretty names for `React.Fragment` and `React.forwardRef`. Thus the snapshot results in ``. * no need for a constant definition here --- core-blocks/more/test/edit.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core-blocks/more/test/edit.js b/core-blocks/more/test/edit.js index 9dd3e5db9ee80..8c7bad4e170c1 100644 --- a/core-blocks/more/test/edit.js +++ b/core-blocks/more/test/edit.js @@ -1,7 +1,8 @@ /** * External dependencies */ -import { shallow } from 'enzyme'; +import Shallow from 'react-test-renderer/shallow'; +const ShallowRenderer = new Shallow(); /** * Internal dependencies */ @@ -17,12 +18,12 @@ describe( 'core/more/edit', () => { attributes.noTeaser = false; } ); test( 'should match snapshot when noTeaser is false', () => { - const wrapper = shallow( ); - expect( wrapper ).toMatchSnapshot(); + ShallowRenderer.render( ); + expect( ShallowRenderer.getRenderOutput() ).toMatchSnapshot(); } ); test( 'should match snapshot when noTeaser is true', () => { attributes.noTeaser = true; - const wrapper = shallow( ); - expect( wrapper ).toMatchSnapshot(); + ShallowRenderer.render( ); + expect( ShallowRenderer.getRenderOutput() ).toMatchSnapshot(); } ); } );