diff --git a/packages/editor/src/components/post-text-editor/test/index.js b/packages/editor/src/components/post-text-editor/test/index.js index 5d242ba31ddead..a9d2d742e9d13e 100644 --- a/packages/editor/src/components/post-text-editor/test/index.js +++ b/packages/editor/src/components/post-text-editor/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { render, screen } from '@testing-library/react'; +import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; /** @@ -117,7 +117,9 @@ describe( 'PostTextEditor', () => { await user.clear( textarea ); // Stop editing. - textarea.blur(); + act( () => { + textarea.blur(); + } ); expect( mockResetEditorBlocks ).toHaveBeenCalledWith( [] ); } ); @@ -147,7 +149,9 @@ describe( 'PostTextEditor', () => { rerender( ); - textarea.blur(); + act( () => { + textarea.blur(); + } ); expect( textarea ).toHaveValue( 'Goodbye World' ); } );