@@ -6,7 +6,7 @@ import { describe, it } from '@ephox/bedrock-client';
66import { getTinymce } from '../../../main/ts/TinyMCE' ;
77import { EventStore , VERSIONS } from '../alien/TestHelpers' ;
88import { Editor as TinyMCEEditor , EditorEvent , Events } from 'tinymce' ;
9- import { Assertions } from '@ephox/agar' ;
9+ import { Assertions , Waiter } from '@ephox/agar' ;
1010import { TinyAssertions } from '@ephox/mcagar' ;
1111
1212type SetContentEvent = EditorEvent < Events . EditorEventMap [ 'SetContent' ] > ;
@@ -89,6 +89,7 @@ describe('EditorBehaviourTest', () => {
8989 await ctx . reRender ( { onSetContent : eventStore . createHandler ( 'onSetContent' ) } ) ;
9090
9191 TinyAssertions . assertContent ( ctx . editor , '<p>Initial Content</p>' ) ;
92+ await Waiter . pWait ( 0 ) ;
9293 ctx . editor . setContent ( '<p>New Content</p>' ) ;
9394
9495 eventStore . each < SetContentEvent > ( 'onSetContent' , ( events ) => {
@@ -98,7 +99,6 @@ describe('EditorBehaviourTest', () => {
9899 events [ 0 ] . editorEvent . content
99100 ) ;
100101 } ) ;
101-
102102 eventStore . clearState ( ) ;
103103 } ) ;
104104
@@ -114,8 +114,8 @@ describe('EditorBehaviourTest', () => {
114114 } ) ;
115115 eventStore . clearState ( ) ;
116116 ctx . editor . setContent ( '<p>Initial Content</p>' ) ;
117-
118117 await ctx . reRender ( { onSetContent : eventStore . createHandler ( 'NewHandler' ) } ) ;
118+ await Waiter . pWait ( 0 ) ;
119119 ctx . editor . setContent ( '<p>New Content</p>' ) ;
120120
121121 eventStore . each < SetContentEvent > ( 'InitialHandler' , ( events ) => {
0 commit comments