From 6214193f73803b3f83cb70aa2de1baddddfc3809 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Fri, 2 Sep 2022 16:01:48 +0300 Subject: [PATCH] Block Editor: Refactor BlockView tests to @testing-library/react --- .../test/__snapshots__/block-view.js.snap | 54 ++++++++++--------- .../block-compare/test/block-view.js | 6 +-- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/packages/block-editor/src/components/block-compare/test/__snapshots__/block-view.js.snap b/packages/block-editor/src/components/block-compare/test/__snapshots__/block-view.js.snap index 46d61bf580fa2..f8abe9753c031 100644 --- a/packages/block-editor/src/components/block-compare/test/__snapshots__/block-view.js.snap +++ b/packages/block-editor/src/components/block-compare/test/__snapshots__/block-view.js.snap @@ -1,40 +1,42 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`BlockView should match snapshot 1`] = ` -
+
-

- title -

- raw +

+ title +

+
+ raw +
+
+
+ render +
+
- - render - +
-
- - action - -
`; diff --git a/packages/block-editor/src/components/block-compare/test/block-view.js b/packages/block-editor/src/components/block-compare/test/block-view.js index 04b3f34ffd1fe..3edd3b6cddad2 100644 --- a/packages/block-editor/src/components/block-compare/test/block-view.js +++ b/packages/block-editor/src/components/block-compare/test/block-view.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { shallow } from 'enzyme'; +import { render } from '@testing-library/react'; /** * Internal dependencies @@ -12,7 +12,7 @@ const noop = () => {}; describe( 'BlockView', () => { test( 'should match snapshot', () => { - const wrapper = shallow( + const { container } = render( { /> ); - expect( wrapper ).toMatchSnapshot(); + expect( container ).toMatchSnapshot(); } ); } );