diff --git a/packages/editor/src/components/post-type-support-check/test/index.js b/packages/editor/src/components/post-type-support-check/test/index.js index 251cf1a0052225..c9f9e0ab1ebe36 100644 --- a/packages/editor/src/components/post-type-support-check/test/index.js +++ b/packages/editor/src/components/post-type-support-check/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { create } from 'react-test-renderer'; +import { render } from '@testing-library/react'; /** * Internal dependencies @@ -10,27 +10,26 @@ import { PostTypeSupportCheck } from '../'; describe( 'PostTypeSupportCheck', () => { it( 'renders its children when post type is not known', () => { - let postType; - const tree = create( - + const { container } = render( + Supported ); - expect( tree.toJSON() ).toBe( 'Supported' ); + expect( container ).toHaveTextContent( 'Supported' ); } ); it( 'does not render its children when post type is known and not supports', () => { const postType = { supports: {}, }; - const tree = create( + const { container } = render( Supported ); - expect( tree.toJSON() ).toBe( null ); + expect( container ).not.toHaveTextContent( 'Supported' ); } ); it( 'renders its children when post type is known and supports', () => { @@ -39,13 +38,13 @@ describe( 'PostTypeSupportCheck', () => { title: true, }, }; - const tree = create( + const { container } = render( Supported ); - expect( tree.toJSON() ).toBe( 'Supported' ); + expect( container ).toHaveTextContent( 'Supported' ); } ); it( 'renders its children if some of keys supported', () => { @@ -54,7 +53,7 @@ describe( 'PostTypeSupportCheck', () => { title: true, }, }; - const tree = create( + const { container } = render( { ); - expect( tree.toJSON() ).toBe( 'Supported' ); + expect( container ).toHaveTextContent( 'Supported' ); } ); it( 'does not render its children if none of keys supported', () => { const postType = { supports: {}, }; - const tree = create( + const { container } = render( { ); - expect( tree.toJSON() ).toBe( null ); + expect( container ).not.toHaveTextContent( 'Supported' ); } ); } );