|
|
@@ -17,7 +17,6 @@ import Writer from '@ckeditor/ckeditor5-engine/src/model/writer';
|
|
|
|
|
|
import ViewText from '@ckeditor/ckeditor5-engine/src/view/text';
|
|
|
import ViewElement from '@ckeditor/ckeditor5-engine/src/view/element';
|
|
|
-import ViewSelection from '@ckeditor/ckeditor5-engine/src/view/selection';
|
|
|
|
|
|
import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
|
|
|
import { getCode } from '@ckeditor/ckeditor5-utils/src/keyboard';
|
|
|
@@ -260,7 +259,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should set model selection appropriately to view selection passed in mutations event', () => {
|
|
|
// This test case emulates spellchecker correction.
|
|
|
|
|
|
- const viewSelection = new ViewSelection();
|
|
|
+ const viewSelection = view.createSelection();
|
|
|
viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
|
|
|
|
|
|
viewDocument.fire( 'mutations',
|
|
|
@@ -280,7 +279,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should use up to one insert and remove operations (spellchecker)', () => {
|
|
|
// This test case emulates spellchecker correction.
|
|
|
|
|
|
- const viewSelection = new ViewSelection();
|
|
|
+ const viewSelection = view.createSelection();
|
|
|
viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
|
|
|
|
|
|
testUtils.sinon.spy( Writer.prototype, 'insert' );
|
|
|
@@ -304,7 +303,7 @@ describe( 'Input feature', () => {
|
|
|
// This test case emulates spellchecker correction.
|
|
|
editor.setData( '<p>Foo hous a</p>' );
|
|
|
|
|
|
- const viewSelection = new ViewSelection();
|
|
|
+ const viewSelection = view.createSelection();
|
|
|
viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
|
|
|
viewDocument.fire( 'mutations',
|
|
|
@@ -325,7 +324,7 @@ describe( 'Input feature', () => {
|
|
|
// This test case emulates spellchecker correction.
|
|
|
editor.setData( '<p>Bar athat foo</p>' );
|
|
|
|
|
|
- const viewSelection = new ViewSelection();
|
|
|
+ const viewSelection = view.createSelection();
|
|
|
viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
|
|
|
|
|
|
viewDocument.fire( 'mutations',
|
|
|
@@ -346,7 +345,7 @@ describe( 'Input feature', () => {
|
|
|
// This test case emulates spellchecker correction.
|
|
|
editor.setData( '<p>Foo hous e</p>' );
|
|
|
|
|
|
- const viewSelection = new ViewSelection();
|
|
|
+ const viewSelection = view.createSelection();
|
|
|
viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
|
|
|
viewDocument.fire( 'mutations',
|
|
|
@@ -366,7 +365,7 @@ describe( 'Input feature', () => {
|
|
|
it( 'should place non-collapsed selection after changing single character (composition)', () => {
|
|
|
editor.setData( '<p>Foo house</p>' );
|
|
|
|
|
|
- const viewSelection = new ViewSelection();
|
|
|
+ const viewSelection = view.createSelection();
|
|
|
viewSelection.setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
|
|
|
viewSelection.setFocus( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
|
|
|
|