Skip to content

Commit 25a2a3d

Browse files
committed
Attempt to fix flaky test
1 parent fce9cae commit 25a2a3d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tinymce-angular-component/src/test/ts/alien/TestHooks.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,17 @@ export const editorHook = <T = unknown>(component: Type<T>, moduleDef: TestModul
7777
if (editor.initialized) {
7878
resolve(editor);
7979
}
80-
editor.once( 'SkinLoaded', () => resolve(editor));
80+
editor.once('SkinLoaded', () => {
81+
// This is a workaround to avoid a race condition occurring in tinymce 8 where licenseKeyManager is still validating the license key
82+
// after global tinymce is removed in a clean up. Specifically, it happens when unloading/loading different versions of TinyMCE
83+
if (editor.licenseKeyManager) {
84+
editor.licenseKeyManager.validate({}).then(() => {
85+
resolve(editor);
86+
}).catch((reason) => console.warn(reason));
87+
} else {
88+
resolve(editor);
89+
}
90+
});
8191
})
8292
),
8393
map(

0 commit comments

Comments
 (0)