Unverified Commit 8d003dc7 authored by Aleksander Nowodzinski's avatar Aleksander Nowodzinski Committed by GitHub

Merge pull request #18 from ckeditor/t/ckeditor5/1341

Tests: Added a test checking memory leaks when the editor is created and destroyed (see ckeditor/ckeditor5#1341).
parents f469dbc6 87b70fa4
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import DecoupledEditor from '../src/ckeditor'; import DecoupledEditor from '../src/ckeditor';
import BaseDecoupledEditor from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor'; import BaseDecoupledEditor from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor';
import { describeMemoryUsage, testMemoryUsage } from '@ckeditor/ckeditor5-core/tests/_utils/memory';
describe( 'DecoupledEditor build', () => { describe( 'DecoupledEditor build', () => {
let editor, editorData, editorElement; let editor, editorData, editorElement;
...@@ -25,7 +26,7 @@ describe( 'DecoupledEditor build', () => { ...@@ -25,7 +26,7 @@ describe( 'DecoupledEditor build', () => {
editor = null; editor = null;
} ); } );
describe( 'buid', () => { describe( 'build', () => {
it( 'contains plugins', () => { it( 'contains plugins', () => {
expect( DecoupledEditor.builtinPlugins ).to.not.be.empty; expect( DecoupledEditor.builtinPlugins ).to.not.be.empty;
} ); } );
...@@ -59,6 +60,12 @@ describe( 'DecoupledEditor build', () => { ...@@ -59,6 +60,12 @@ describe( 'DecoupledEditor build', () => {
} ); } );
} ); } );
describeMemoryUsage( () => {
testMemoryUsage(
'should not grow on multiple create/destroy',
() => DecoupledEditor.create( document.querySelector( '#mem-editor' ) ) );
} );
function test( getEditorDataOrElement ) { function test( getEditorDataOrElement ) {
describe( 'create()', () => { describe( 'create()', () => {
beforeEach( () => { beforeEach( () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment