Skip to content

Commit f41769b

Browse files
committed
INT-3336: Wait for editor content to have been updated
1 parent bae01c8 commit f41769b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/ts/browser/EditorBehaviorTest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { describe, it } from '@ephox/bedrock-client';
66
import { getTinymce } from '../../../main/ts/TinyMCE';
77
import { EventStore, VERSIONS } from '../alien/TestHelpers';
88
import { Editor as TinyMCEEditor, EditorEvent, Events } from 'tinymce';
9-
import { Assertions } from '@ephox/agar';
9+
import { Assertions, Waiter } from '@ephox/agar';
1010
import { TinyAssertions } from '@ephox/mcagar';
1111

1212
type 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

Comments
 (0)