diff options
Diffstat (limited to 'tests/unit/testsuite.js')
-rw-r--r-- | tests/unit/testsuite.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index ddc59ed08..6e840f415 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -175,6 +175,18 @@ TestHelpers.commonWidgetTests = function( widget, settings ) { }); }; +TestHelpers.onFocus= function( element, onFocus ) { + var fn = function( event ){ + if( !event.originalEvent ) { + return; + } + element.unbind( "focus", fn ); + onFocus(); + }; + + element.bind( "focus", fn )[ 0 ].focus(); +}; + /* * Taken from https://github.com/jquery/qunit/tree/master/addons/close-enough */ |