@@ -29,18 +29,15 @@ import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml'
describe( 'ArticlePluginSet', () => {
let editor, editorElement;
- beforeEach( () => {
+ beforeEach( async () => {
editorElement = document.createElement( 'div' );
document.body.appendChild( editorElement );
- return ClassicTestEditor.create( editorElement, { plugins: [ ArticlePluginSet ] } )
- .then( newEditor => {
- editor = newEditor;
- } );
+ editor = await ClassicTestEditor.create( editorElement, { plugins: [ ArticlePluginSet ] } );
} );
- afterEach( () => {
- editor.destroy();
+ afterEach( async () => {
+ await editor.destroy();
editorElement.remove();
@@ -147,6 +147,7 @@ function collectMemoryStats() {
// google-chrome -js-flags="--expose-gc"
//
function skipIfNoGarbageCollector() {
+ // eslint-disable-next-line mocha/no-top-level-hooks
before( function() {
if ( !window.gc ) {
this.skip();
@@ -34,6 +34,7 @@ const utils = {
*/
createSinonSandbox() {
afterEach( () => {
utils.sinon.restore();
@@ -149,7 +149,7 @@ describe( 'Editor', () => {
bar: 'foo',
foo: {
c: 3
- },
+ }
expect( editor.config.get( 'foo' ) ).to.deep.equal( {
@@ -22,10 +22,11 @@ describe( 'DataApiMixin', () => {
editor.model.document.createRoot( '$root', 'main' );
editor.model.document.createRoot( '$root', 'secondRoot' );
editor.model.schema.extend( '$text', { allowIn: '$root' } );
+ editor.fire( 'ready' ); // (#6139)
describe( 'setData()', () => {
@@ -15,17 +15,20 @@ describe( 'ElementApiMixin', () => {
let editor;
beforeEach( () => {
- class CustomEditor extends Editor {}
+ class CustomEditor extends Editor {
+
mix( CustomEditor, ElementApiMixin );
editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor( editor.editing.view.document );
editor.model.document.createRoot();
describe( 'updateSourceElement()', () => {
@@ -14,7 +14,7 @@ document.getElementById( 'form' ).submit = () => {};
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ ArticlePluginSet ],
- toolbar: [ 'bold', 'italic', 'undo', 'redo' ],
+ toolbar: [ 'bold', 'italic', 'undo', 'redo' ]
} )
.then( editor => {
window.editor = editor;
@@ -15,7 +15,7 @@ ClassicEditor
plugins: [ ArticlePluginSet, PendingActions ],
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ],
image: {
- toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ],
+ toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
}
plugins: [ ArticlePluginSet, BalloonToolbar ],
},
balloonToolbar: [ 'bold', 'italic', 'link' ]
@@ -12,7 +12,7 @@ let editor, pendingActions;
describe( 'PendingActions', () => {
return VirtualTestEditor.create( {
- plugins: [ PendingActions ],
+ plugins: [ PendingActions ]
} ).then( newEditor => {
editor = newEditor;
pendingActions = editor.plugins.get( PendingActions );