diff --git a/packages/edit-post/src/test/editor.native.js b/packages/edit-post/src/test/editor.native.js index cedd6bf8c94b3..d87b74d7014b3 100644 --- a/packages/edit-post/src/test/editor.native.js +++ b/packages/edit-post/src/test/editor.native.js @@ -3,6 +3,8 @@ */ import RNReactNativeGutenbergBridge from 'react-native-gutenberg-bridge'; import { mount } from 'enzyme'; +import { act } from "react-dom/test-utils"; + /** * WordPress dependencies */ @@ -31,6 +33,10 @@ describe( 'Editor', () => { RNReactNativeGutenbergBridge.editorDidMount = jest.fn(); const appContainer = renderEditorWith( unsupportedBlock ); + // for some reason resetEditorBlocks() is asynchronous when dispatching editEntityRecord + act ( () => { + jest.runAllTicks(); + } ); appContainer.unmount(); expect( RNReactNativeGutenbergBridge.editorDidMount ).toHaveBeenCalledTimes( 1 );