Browse Source

Merge pull request #107 from ckeditor/t/106

Tests: Added a test case checking the `LinkFormView` integration with the `FocusTracker`. Closes #106.
Aleksander Nowodzinski 8 years ago
parent
commit
acb3e0e2fe
1 changed files with 11 additions and 0 deletions
  1. 11 0
      packages/ckeditor5-link/tests/link.js

+ 11 - 0
packages/ckeditor5-link/tests/link.js

@@ -593,6 +593,17 @@ describe( 'Link', () => {
 			focusEditableSpy = testUtils.sinon.spy( editor.editing.view, 'focus' );
 		} );
 
+		it( 'should mark the editor ui as focused when the #formView is focused', () => {
+			return linkFeature._showPanel()
+				.then( () => {
+					editor.ui.focusTracker.isFocused = false;
+
+					formView.element.dispatchEvent( new Event( 'focus' ) );
+
+					expect( editor.ui.focusTracker.isFocused ).to.true;
+				} );
+		} );
+
 		describe( 'binding', () => {
 			it( 'should bind formView.urlInputView#value to link command value', () => {
 				const command = editor.commands.get( 'link' );