Skip to content

Commit

Permalink
Mock @wordpress/notices in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TimBroddin committed Mar 6, 2023
1 parent f1baa30 commit abf6326
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jest.mock( '@wordpress/block-editor', () => ( {
} ),
} ) );

jest.mock( '@wordpress/notices', () => {}, { virtual: true } );

describe( 'SubscriptionEdit', () => {
test( 'adds correct classes to container', async () => {
const { container } = render( <SubscriptionEdit { ...defaultProps } /> );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import runBlockFixtureTests from '../../../shared/test/block-fixtures';
// The main block should be the first in the array.
const blocks = [ { name: `jetpack/${ name }`, settings } ];

jest.mock( '@wordpress/notices', () => {}, { virtual: true } );

runBlockFixtureTests( `jetpack/${ name }`, blocks, __dirname );

0 comments on commit abf6326

Please sign in to comment.