Преглед изворни кода

Tests: Updated stubs to the latest Sinon API.

Aleksander Nowodzinski пре 8 година
родитељ
комит
21665dba4c

+ 2 - 2
packages/ckeditor5-utils/tests/dom/rect.js

@@ -768,14 +768,14 @@ describe( 'Rect', () => {
 
 		describe( 'excludeScrollbars', () => {
 			it( 'should exclude scrollbars from viewport\'s rect', () => {
-				testUtils.sinon.stub( global, 'window', {
+				testUtils.sinon.stub( global, 'window' ).value( {
 					innerWidth: 1000,
 					innerHeight: 500,
 					scrollX: 100,
 					scrollY: 200
 				} );
 
-				testUtils.sinon.stub( global, 'document', {
+				testUtils.sinon.stub( global, 'document' ).value( {
 					documentElement: {
 						clientWidth: 990,
 						clientHeight: 490

+ 5 - 5
packages/ckeditor5-utils/tests/dom/scroll.js

@@ -26,7 +26,7 @@ describe( 'scrollAncestorsToShowTarget()', () => {
 		secondAncestor = document.createElement( 'div' );
 		body = document.createElement( 'div' );
 
-		testUtils.sinon.stub( global, 'document', { body } );
+		testUtils.sinon.stub( global, 'document' ).value( { body } );
 
 		document.body.appendChild( body );
 		body.appendChild( secondAncestor );
@@ -34,12 +34,12 @@ describe( 'scrollAncestorsToShowTarget()', () => {
 		firstAncestor.appendChild( element );
 
 		// Make the element immune to the border-width-* styles in the test environment.
-		testUtils.sinon.stub( global.window, 'getComputedStyle', () => ( {
+		testUtils.sinon.stub( global.window, 'getComputedStyle' ).returns( {
 			borderTopWidth: '0px',
 			borderRightWidth: '0px',
 			borderBottomWidth: '0px',
 			borderLeftWidth: '0px'
-		} ) );
+		} );
 
 		stubRect( firstAncestor, {
 			top: 0, right: 100, bottom: 100, left: 0, width: 100, height: 100
@@ -168,7 +168,7 @@ describe( 'scrollViewportToShowTarget()', () => {
 			scrollLeft: 100, scrollTop: 100
 		} );
 
-		testUtils.sinon.stub( global, 'window', {
+		testUtils.sinon.stub( global, 'window' ).value( {
 			innerWidth: 1000,
 			innerHeight: 500,
 			scrollX: 100,
@@ -183,7 +183,7 @@ describe( 'scrollViewportToShowTarget()', () => {
 		} );
 
 		// Assuming 20px v- and h-scrollbars here.
-		testUtils.sinon.stub( global, 'document', {
+		testUtils.sinon.stub( global, 'document' ).value( {
 			body: document.body,
 			documentElement: {
 				clientWidth: 980,