Parcourir la source

Tests: Should not log a warning which is expected to be logged.

Piotrek Koszuliński il y a 9 ans
Parent
commit
9d18a4828c
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      packages/ckeditor5-engine/tests/model/liveselection.js

+ 6 - 1
packages/ckeditor5-engine/tests/model/liveselection.js

@@ -21,6 +21,8 @@ import count from 'ckeditor5/utils/count.js';
 import testUtils from 'tests/core/_utils/utils.js';
 import testUtils from 'tests/core/_utils/utils.js';
 import { wrapInDelta } from 'tests/engine/model/_utils/utils.js';
 import { wrapInDelta } from 'tests/engine/model/_utils/utils.js';
 
 
+import log from 'ckeditor5/utils/log.js';
+
 testUtils.createSinonSandbox();
 testUtils.createSinonSandbox();
 
 
 describe( 'LiveSelection', () => {
 describe( 'LiveSelection', () => {
@@ -136,13 +138,16 @@ describe( 'LiveSelection', () => {
 		} );
 		} );
 
 
 		it( 'should not add a range that is in graveyard', () => {
 		it( 'should not add a range that is in graveyard', () => {
+			const spy = testUtils.sinon.stub( log, 'warn' );
+
 			selection.addRange( Range.createIn( doc.graveyard ) );
 			selection.addRange( Range.createIn( doc.graveyard ) );
 
 
 			expect( selection._ranges.length ).to.equal( 0 );
 			expect( selection._ranges.length ).to.equal( 0 );
+			expect( spy.calledOnce ).to.be.true;
 		} );
 		} );
 
 
 		it( 'should refresh attributes', () => {
 		it( 'should refresh attributes', () => {
-			const spy = sinon.spy( selection, '_updateAttributes' );
+			const spy = testUtils.sinon.spy( selection, '_updateAttributes' );
 
 
 			selection.addRange( range );
 			selection.addRange( range );