Browse Source

Add FocusTracker.destroy() test.

Maciej Gołaszewski 6 years ago
parent
commit
1bd766ba22
1 changed files with 10 additions and 0 deletions
  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 );
+		} );
+	} );
 } );