Explorar el Código

Tests: Added mising test in `view.Position` and fixing CC.

Szymon Cofalik hace 8 años
padre
commit
7692ed2520
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      packages/ckeditor5-engine/tests/view/position.js

+ 8 - 0
packages/ckeditor5-engine/tests/view/position.js

@@ -594,6 +594,14 @@ describe( 'Position', () => {
 			test( firstPosition, secondPosition, section );
 		} );
 
+		it( 'for two positions in different trees returns null', () => {
+			const div = new Element( 'div' );
+			const posInDiv = new Position( div, 0 );
+			const firstPosition = new Position( liOl2, 10 );
+
+			test( posInDiv, firstPosition, null );
+		} );
+
 		function test( positionA, positionB, lca ) {
 			expect( positionA.getCommonAncestor( positionB ) ).to.equal( lca );
 			expect( positionB.getCommonAncestor( positionA ) ).to.equal( lca );