Explorar o código

Tests: Fixed a Document#scrollToTheSelection test failing due to unstable geometry of the DOM.

Aleksander Nowodzinski %!s(int64=8) %!d(string=hai) anos
pai
achega
2665e58d17
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      packages/ckeditor5-engine/tests/view/document/document.js

+ 7 - 0
packages/ckeditor5-engine/tests/view/document/document.js

@@ -342,6 +342,13 @@ describe( 'Document', () => {
 			const root = viewDocument.createRoot( domRoot );
 			const root = viewDocument.createRoot( domRoot );
 			const range = ViewRange.createIn( root );
 			const range = ViewRange.createIn( root );
 
 
+			// Make sure the window will have to scroll to the domRoot.
+			Object.assign( domRoot.style, {
+				position: 'absolute',
+				top: '-1000px',
+				left: '-1000px'
+			} );
+
 			viewDocument.selection.addRange( range );
 			viewDocument.selection.addRange( range );
 
 
 			viewDocument.scrollToTheSelection();
 			viewDocument.scrollToTheSelection();