Browse Source

Tests: expanded tests for model/view.Selection to cover more cases.

Szymon Cofalik 9 years ago
parent
commit
8564bd1021

+ 3 - 1
packages/ckeditor5-engine/tests/model/selection.js

@@ -682,11 +682,13 @@ describe( 'Selection', () => {
 			expect( selection.isEqual( otherSelection ) ).to.be.false;
 		} );
 
-		it( 'should return false if ranges do not equal', () => {
+		it( 'should return false if ranges (other than the last added range) do not equal', () => {
 			selection.addRange( range1 );
+			selection.addRange( range3 );
 
 			const otherSelection = new Selection();
 			otherSelection.addRange( range2 );
+			otherSelection.addRange( range3 );
 
 			expect( selection.isEqual( otherSelection ) ).to.be.false;
 		} );

+ 3 - 1
packages/ckeditor5-engine/tests/view/selection.js

@@ -443,11 +443,13 @@ describe( 'Selection', () => {
 			expect( selection.isEqual( otherSelection ) ).to.be.false;
 		} );
 
-		it( 'should return false if ranges do not equal', () => {
+		it( 'should return false if ranges (other than the last added one) do not equal', () => {
 			selection.addRange( range1 );
+			selection.addRange( range3 );
 
 			const otherSelection = new Selection();
 			otherSelection.addRange( range2 );
+			otherSelection.addRange( range3 );
 
 			expect( selection.isEqual( otherSelection ) ).to.be.false;
 		} );