]> source.dussan.org Git - jquery-ui.git/commitdiff
Core tests: Handle async focus in IE.
authorScott González <scott.gonzalez@gmail.com>
Mon, 10 Dec 2012 15:34:44 +0000 (10:34 -0500)
committerScott González <scott.gonzalez@gmail.com>
Mon, 10 Dec 2012 15:34:44 +0000 (10:34 -0500)
tests/unit/core/core.js

index 5ebb9e9f4e5ca1f854e9b42c624771bc2a3f1964..86b95e157ddb840b96ea0e63119b99e91688c0c0 100644 (file)
@@ -4,11 +4,12 @@ module( "core - jQuery extensions" );
 
 TestHelpers.testJshint( "core" );
 
-test( "focus - original functionality", function() {
+asyncTest( "focus - original functionality", function() {
        expect( 1 );
        $( "#inputTabindex0" )
-               .focus(function() {
+               .one( "focus", function() {
                        ok( true, "event triggered" );
+                       start();
                })
                .focus();
 });
@@ -16,12 +17,10 @@ test( "focus - original functionality", function() {
 asyncTest( "focus", function() {
        expect( 2 );
        $( "#inputTabindex0" )
-               .focus(function() {
+               .one( "focus", function() {
                        ok( true, "event triggered" );
                })
                .focus( 500, function() {
-                       // prevent double focus event in IE
-                       $( this ).unbind( "focus" );
                        ok( true, "callback triggered" );
                        start();
                });