Kaynağa Gözat

Fixed paths to view selection.

Szymon Kupś 7 yıl önce
ebeveyn
işleme
79093a26aa

+ 7 - 7
packages/ckeditor5-typing/tests/input.js

@@ -15,7 +15,7 @@ import ModelRange from '@ckeditor/ckeditor5-engine/src/model/range';
 
 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 ViewDocumentSelection from '@ckeditor/ckeditor5-engine/src/view/documentselection';
 
 import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
 import { getCode } from '@ckeditor/ckeditor5-utils/src/keyboard';
@@ -262,7 +262,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 = new ViewDocumentSelection();
 			viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
 
 			viewDocument.fire( 'mutations',
@@ -282,7 +282,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 = new ViewDocumentSelection();
 			viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 6 );
 
 			testUtils.sinon.spy( Writer.prototype, 'insert' );
@@ -306,7 +306,7 @@ describe( 'Input feature', () => {
 			// This test case emulates spellchecker correction.
 			editor.setData( '<p>Foo hous a</p>' );
 
-			const viewSelection = new ViewSelection();
+			const viewSelection = new ViewDocumentSelection();
 			viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
 
 			viewDocument.fire( 'mutations',
@@ -327,7 +327,7 @@ describe( 'Input feature', () => {
 			// This test case emulates spellchecker correction.
 			editor.setData( '<p>Bar athat foo</p>' );
 
-			const viewSelection = new ViewSelection();
+			const viewSelection = new ViewDocumentSelection();
 			viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
 
 			viewDocument.fire( 'mutations',
@@ -348,7 +348,7 @@ describe( 'Input feature', () => {
 			// This test case emulates spellchecker correction.
 			editor.setData( '<p>Foo hous e</p>' );
 
-			const viewSelection = new ViewSelection();
+			const viewSelection = new ViewDocumentSelection();
 			viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
 
 			viewDocument.fire( 'mutations',
@@ -368,7 +368,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 = new ViewDocumentSelection();
 			viewSelection._setTo( viewRoot.getChild( 0 ).getChild( 0 ), 8 );
 			viewSelection._setFocus( viewRoot.getChild( 0 ).getChild( 0 ), 9 );
 

+ 2 - 2
packages/ckeditor5-typing/tests/spellchecking.js

@@ -14,7 +14,7 @@ import Undo from '@ckeditor/ckeditor5-undo/src/undo';
 
 import ModelRange from '@ckeditor/ckeditor5-engine/src/model/range';
 
-import ViewSelection from '@ckeditor/ckeditor5-engine/src/view/selection';
+import ViewDocumentSelection from '@ckeditor/ckeditor5-engine/src/view/documentselection';
 
 import { getData as getModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
@@ -234,7 +234,7 @@ describe( 'Typing – spellchecking integration', () => {
 function emulateSpellcheckerMutation( editor, nodeIndex, resultPositionIndex, oldText, newText ) {
 	const view = editor.editing.view;
 	const viewRoot = view.document.getRoot();
-	const viewSelection = new ViewSelection();
+	const viewSelection = new ViewDocumentSelection();
 
 	viewSelection._setTo( viewRoot.getChild( nodeIndex ).getChild( 0 ), resultPositionIndex );
 

+ 3 - 3
packages/ckeditor5-typing/tests/tickets/100.js

@@ -16,7 +16,7 @@ import { upcastElementToElement } from '@ckeditor/ckeditor5-engine/src/conversio
 import ViewText from '@ckeditor/ckeditor5-engine/src/view/text';
 import ViewElement from '@ckeditor/ckeditor5-engine/src/view/element';
 import ViewContainerElement from '@ckeditor/ckeditor5-engine/src/view/containerelement';
-import ViewSelection from '@ckeditor/ckeditor5-engine/src/view/selection';
+import ViewDocumentSelection from '@ckeditor/ckeditor5-engine/src/view/documentselection';
 import MutationObserver from '@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver';
 
 import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
@@ -402,7 +402,7 @@ describe( 'Bug ckeditor5-typing#100', () => {
 
 		const paragraph = viewRoot.getChild( 0 );
 		const strong = paragraph.getChild( 0 );
-		const viewSelection = new ViewSelection( paragraph, 0 );
+		const viewSelection = new ViewDocumentSelection( paragraph, 0 );
 
 		// Simulate mutations and DOM change.
 		domRoot.childNodes[ 0 ].innerHTML = '<b>textx</b>';
@@ -426,7 +426,7 @@ describe( 'Bug ckeditor5-typing#100', () => {
 
 		const paragraph = viewRoot.getChild( 0 );
 		const strong = paragraph.getChild( 0 );
-		const viewSelection = new ViewSelection( paragraph, 0 );
+		const viewSelection = new ViewDocumentSelection( paragraph, 0 );
 
 		// Simulate mutations and DOM change.
 		domRoot.childNodes[ 0 ].innerHTML = '<strong>Foo bar </strong><b>apple</b>';