/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
import MutationObserver from '../../src/view/observer/mutationobserver';
import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor.js';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import { getData as getModelData, setData as setModelData } from '../../src/dev-utils/model';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js';
import { getData as getViewData } from '../../src/dev-utils/view';
import { isInlineFiller } from '../../src/view/filler';
import Input from '@ckeditor/ckeditor5-typing/src/input';
/* globals document */
describe( 'Bug ckeditor5#692', () => {
let editorElement, editor, mutationObserver, view, domEditor;
beforeEach( () => {
editorElement = document.createElement( 'div' );
document.body.appendChild( editorElement );
return ClassicTestEditor
.create( editorElement, {
plugins: [ Paragraph, Bold, Input ]
} )
.then( newEditor => {
editor = newEditor;
view = editor.editing.view;
mutationObserver = view.getObserver( MutationObserver );
domEditor = editor.ui.getEditableElement();
} );
} );
afterEach( () => {
document.body.removeChild( editorElement );
return editor.destroy();
} );
describe( 'DomConverter', () => {
// https://github.com/ckeditor/ckeditor5/issues/692 Scenario 1.
it( 'should handle space after inline filler at the end of container (scenario 1)', () => {
setModelData( editor.model, '
foo {}
' ); } ); // https://github.com/ckeditor/ckeditor5/issues/692 Scenario 2. it( 'should handle space after inline filler at the end of container (scenario 2)', () => { setModelData( editor.model, '{}foo
' ); } ); } ); } );