소스 검색

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

Szymon Cofalik 9 년 전
부모
커밋
8564bd1021
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 1
      packages/ckeditor5-engine/tests/model/selection.js
  2. 3 1
      packages/ckeditor5-engine/tests/view/selection.js

+ 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;
 		} );