aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/core
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-04-18 13:04:07 +0000
committerScott González <scott.gonzalez@gmail.com>2009-04-18 13:04:07 +0000
commitcedf663e2f13bb24a1e473c55e49248d98be3f16 (patch)
tree60b14eb1bf3bc61d5d2aaae5db6b91c741c6fb4c /tests/unit/core
parent15788355faa24262a62c5883af40e41239ef6021 (diff)
downloadjquery-ui-cedf663e2f13bb24a1e473c55e49248d98be3f16.tar.gz
jquery-ui-cedf663e2f13bb24a1e473c55e49248d98be3f16.zip
Core: Added asynchronous focus. Fixed #3559 - :focusable, :tabbable, setFocus().
Diffstat (limited to 'tests/unit/core')
-rw-r--r--tests/unit/core/core.js23
1 files changed, 23 insertions, 0 deletions
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);