Sfoglia il codice sorgente

Add test checking fired event after editor's initialization.

Mateusz Samsel 6 anni fa
parent
commit
6829fe2717
1 ha cambiato i file con 14 aggiunte e 0 eliminazioni
  1. 14 0
      packages/ckeditor5-word-count/tests/wordcount.js

+ 14 - 0
packages/ckeditor5-word-count/tests/wordcount.js

@@ -147,6 +147,20 @@ describe( 'WordCount', () => {
 				sinon.assert.calledTwice( fake );
 				sinon.assert.calledWithExactly( fake, sinon.match.any, { words: 2, characters: 12 } );
 			} );
+
+			it( 'should be fired after editor initialization', () => {
+				const fake = sinon.fake();
+
+				return VirtualTestEditor.create( {
+					plugins: [ WordCount, Paragraph, ShiftEnter, TableEditing ],
+					wordCount: {
+						onUpdate: fake
+					}
+				} )
+					.then( () => {
+						sinon.assert.calledOnce( fake );
+					} );
+			} );
 		} );
 	} );