diff options
Diffstat (limited to 'tests/unit/draggable')
-rw-r--r-- | tests/unit/draggable/draggable_core.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index 93c6e4080..3e8e7e0f5 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -262,18 +262,26 @@ test( "#8399: A draggable should become the active element after you are finishe strictEqual( document.activeElement, element.get( 0 ), "finishing moving a draggable anchor made it the active element" ); }); -asyncTest( "#4261: active element should blur when mousing down on a draggable", function() { - expect( 2 ); +asyncTest( "blur behavior", function() { + expect( 3 ); + + var element = $( "#draggable1" ).draggable(), + focusElement = $( "<div tabindex='1'></div>" ).appendTo( element ); + + TestHelpers.onFocus( focusElement, function() { + strictEqual( document.activeElement, focusElement.get( 0 ), "test element is focused before mousing down on a draggable" ); - var textInput = $( "<input>" ).appendTo( "#qunit-fixture" ), - element = $( "#draggable1" ).draggable(); + TestHelpers.draggable.move( focusElement, 1, 1 ); - TestHelpers.onFocus( textInput, function() { - strictEqual( document.activeElement, textInput.get( 0 ), "ensure that a focussed text input is the active element before mousing down on a draggable" ); + // http://bugs.jqueryui.com/ticket/10527 + // Draggable: Can't select option in modal dialog (IE8) + strictEqual( document.activeElement, focusElement.get( 0 ), "test element is focused after mousing down on itself" ); TestHelpers.draggable.move( element, 50, 50 ); - notStrictEqual( document.activeElement, textInput.get( 0 ), "ensure the text input is no longer the active element after mousing down on a draggable" ); + // http://bugs.jqueryui.com/ticket/4261 + // active element should blur when mousing down on a draggable + notStrictEqual( document.activeElement, focusElement.get( 0 ), "test element is no longer focused after mousing down on a draggable" ); start(); }); }); |