From cedf663e2f13bb24a1e473c55e49248d98be3f16 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sat, 18 Apr 2009 13:04:07 +0000 Subject: Core: Added asynchronous focus. Fixed #3559 - :focusable, :tabbable, setFocus(). --- tests/unit/core/core.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 53f392370..96a197aa5 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -25,4 +25,27 @@ test("attr - aria", function() { equals(el.attr('aria-expanded'), 'false', 'aria expanded is false'); }); +test('focus', function() { + expect(3); + + var el = $('#inputTabindex0'), + // used to remove focus from the main element + other = $('#inputTabindex10'); + + // test original functionality + el.focus(function() { + ok(true, 'event triggered'); + }); + el.focus(); + other.focus(); + + // trigger event handler + callback + stop(); + el.focus(500, function() { + start(); + ok(true, 'callback triggered'); + }); + other.focus(); +}); + })(jQuery); -- cgit v1.2.3