Skip to content

Commit

Permalink
Update packages/edit-post/src/components/sidebar/plugin-post-excerpt/…
Browse files Browse the repository at this point in the history
…test/index.js

Co-authored-by: Marin Atanasov <[email protected]>
  • Loading branch information
retrofox and tyxla committed Oct 12, 2023
1 parent 9fc5132 commit 015f948
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { render } from '@testing-library/react';
import { render, screen } from '@testing-library/react';

/**
* WordPress dependencies
Expand All @@ -15,15 +15,22 @@ import PluginPostExcerptPanel from '../';

describe( 'PluginPostExcerptPanel', () => {
test( 'renders fill properly', () => {
const { container } = render(
render(
<SlotFillProvider>
<PluginPostExcerptPanel className="my-plugin-post-excerpt-custom-content">
Post Excerpt - Custom content
</PluginPostExcerptPanel>
<PluginPostExcerptPanel.Slot />
<div role="tabpanel">
<PluginPostExcerptPanel.Slot />
</div>
</SlotFillProvider>
);

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' );
} );
} );

0 comments on commit 015f948

Please sign in to comment.