Skip to content

Commit

Permalink
Fix editor unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tug committed Sep 20, 2019
1 parent e95c9f2 commit 22a0119
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/edit-post/src/test/editor.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*/
import RNReactNativeGutenbergBridge from 'react-native-gutenberg-bridge';
import { mount } from 'enzyme';
import { act } from "react-dom/test-utils";

/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 22a0119

Please sign in to comment.