|
@@ -326,14 +326,14 @@ describe( 'Document', () => {
|
|
|
|
|
|
|
|
describe( 'scrollToTheSelection()', () => {
|
|
describe( 'scrollToTheSelection()', () => {
|
|
|
it( 'does nothing when there are no ranges in the selection', () => {
|
|
it( 'does nothing when there are no ranges in the selection', () => {
|
|
|
- const stub = testUtils.sinon.stub( scrollUtils, 'scrollViewportToShowTarget' ).callsFake( () => {} );
|
|
|
|
|
|
|
+ const stub = testUtils.sinon.stub( scrollUtils, 'scrollViewportToShowTarget' );
|
|
|
|
|
|
|
|
viewDocument.scrollToTheSelection();
|
|
viewDocument.scrollToTheSelection();
|
|
|
sinon.assert.notCalled( stub );
|
|
sinon.assert.notCalled( stub );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'scrolls to the first range in selection with an offset', () => {
|
|
it( 'scrolls to the first range in selection with an offset', () => {
|
|
|
- const stub = testUtils.sinon.stub( scrollUtils, 'scrollViewportToShowTarget' ).callsFake( () => {} );
|
|
|
|
|
|
|
+ const stub = testUtils.sinon.stub( scrollUtils, 'scrollViewportToShowTarget' );
|
|
|
const root = viewDocument.createRoot( document.createElement( 'div' ) );
|
|
const root = viewDocument.createRoot( document.createElement( 'div' ) );
|
|
|
const range = ViewRange.createIn( root );
|
|
const range = ViewRange.createIn( root );
|
|
|
|
|
|