8
0
Просмотр исходного кода

Fixed code coverage of MutationObserver.

Szymon Kupś 9 лет назад
Родитель
Сommit
e27cbdbbfc
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      packages/ckeditor5-engine/tests/view/observer/mutationobserver.js

+ 11 - 0
packages/ckeditor5-engine/tests/view/observer/mutationobserver.js

@@ -49,6 +49,17 @@ describe( 'MutationObserver', () => {
 		expect( lastMutations[ 0 ].oldText ).to.equal( 'foo' );
 	} );
 
+	it( 'should not observe if disabled', () => {
+		const additional = document.getElementById( 'additional' );
+		mutationObserver.disable();
+		viewDocument.createRoot( additional, 'additional' );
+
+		additional.textContent = 'foobar';
+		mutationObserver.flush();
+
+		expect( lastMutations ).to.be.null;
+	} );
+
 	it( 'should handle bold', () => {
 		domEditor.childNodes[ 0 ].childNodes[ 0 ].data = 'f';
 		const domB = document.createElement( 'b' );