Sfoglia il codice sorgente

Add FocusTracker.destroy() test.

Maciej Gołaszewski 7 anni fa
parent
commit
1bd766ba22
1 ha cambiato i file con 10 aggiunte e 0 eliminazioni
  1. 10 0
      packages/ckeditor5-utils/tests/focustracker.js

+ 10 - 0
packages/ckeditor5-utils/tests/focustracker.js

@@ -170,4 +170,14 @@ describe( 'FocusTracker', () => {
 			expect( focusTracker.isFocused ).to.false;
 		} );
 	} );
+
+	describe( 'destroy()', () => {
+		it( 'should stop listening', () => {
+			const stopListeningSpy = sinon.spy( focusTracker, 'stopListening' );
+
+			focusTracker.destroy();
+
+			sinon.assert.calledOnce( stopListeningSpy );
+		} );
+	} );
 } );