浏览代码

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

Piotrek Koszuliński 9 年之前
父节点
当前提交
9d18a4828c
共有 1 个文件被更改,包括 6 次插入1 次删除
  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 { wrapInDelta } from 'tests/engine/model/_utils/utils.js';
 
+import log from 'ckeditor5/utils/log.js';
+
 testUtils.createSinonSandbox();
 
 describe( 'LiveSelection', () => {
@@ -136,13 +138,16 @@ describe( 'LiveSelection', () => {
 		} );
 
 		it( 'should not add a range that is in graveyard', () => {
+			const spy = testUtils.sinon.stub( log, 'warn' );
+
 			selection.addRange( Range.createIn( doc.graveyard ) );
 
 			expect( selection._ranges.length ).to.equal( 0 );
+			expect( spy.calledOnce ).to.be.true;
 		} );
 
 		it( 'should refresh attributes', () => {
-			const spy = sinon.spy( selection, '_updateAttributes' );
+			const spy = testUtils.sinon.spy( selection, '_updateAttributes' );
 
 			selection.addRange( range );