From 015f948ae05f8605cdc01b5d7f807c5638ac335f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Su=C3=A1rez?= Date: Thu, 12 Oct 2023 08:43:54 -0300 Subject: [PATCH] Update packages/edit-post/src/components/sidebar/plugin-post-excerpt/test/index.js Co-authored-by: Marin Atanasov <8436925+tyxla@users.noreply.github.com> --- .../sidebar/plugin-post-excerpt/test/index.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/edit-post/src/components/sidebar/plugin-post-excerpt/test/index.js b/packages/edit-post/src/components/sidebar/plugin-post-excerpt/test/index.js index 31cee0534e87b..4b81a1326d517 100644 --- a/packages/edit-post/src/components/sidebar/plugin-post-excerpt/test/index.js +++ b/packages/edit-post/src/components/sidebar/plugin-post-excerpt/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; /** * WordPress dependencies @@ -15,15 +15,22 @@ import PluginPostExcerptPanel from '../'; describe( 'PluginPostExcerptPanel', () => { test( 'renders fill properly', () => { - const { container } = render( + render( Post Excerpt - Custom content - +
+ +
); - expect( container ).toMatchSnapshot(); + expect( screen.getByRole( 'tabpanel' ) ).toHaveTextContent( + 'Post Excerpt - Custom content' + ); + expect( + screen.getByText( 'Post Excerpt - Custom content' ) + ).toHaveClass( 'my-plugin-post-excerpt-custom-content' ); } ); } );