aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/widget
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-01-31 21:55:22 -0500
committerScott González <scott.gonzalez@gmail.com>2011-01-31 21:55:22 -0500
commit17004b9cac3eb87a72474b6d82d0f0063c23c269 (patch)
tree4df5ef4e4bd62d7a0ce25c759790a49171167a3c /tests/unit/widget
parent3e370a44679da9c2b226d1667f13667f23bd239c (diff)
downloadjquery-ui-17004b9cac3eb87a72474b6d82d0f0063c23c269.tar.gz
jquery-ui-17004b9cac3eb87a72474b6d82d0f0063c23c269.zip
Widget: Use focusin/focusout for ._focusable().
Diffstat (limited to 'tests/unit/widget')
-rw-r--r--tests/unit/widget/widget_core.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index b701193cf..d993194e2 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -137,7 +137,7 @@ test( "error handling", function() {
$.error = error;
});
-test("merge multiple option arguments", function() {
+test( "merge multiple option arguments", function() {
expect( 1 );
$.widget( "ui.testWidget", {
_create: function() {
@@ -173,7 +173,7 @@ test("merge multiple option arguments", function() {
});
});
-test( "_getCreateOptions()", function() {
+test( "._getCreateOptions()", function() {
expect( 1 );
$.widget( "ui.testWidget", {
options: {
@@ -488,6 +488,10 @@ test( "._bind() to descendent", function() {
descendent
.trigger( "keyup" )
.trigger( "keydown" );
+ descendent
+ .addClass( "ui-state-disabled" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
widget
.testWidget( "destroy" )
.trigger( "keyup" )
@@ -537,25 +541,25 @@ test( "._focusable()", function() {
var div = $( "#widget" ).testWidget().children();
ok( !div.hasClass( "ui-state-focus" ), "not focused on init" );
- div.trigger( "focus" );
+ div.trigger( "focusin" );
ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
- div.trigger( "blur" );
+ div.trigger( "focusout" );
ok( !div.hasClass( "ui-state-focus" ), "not focused after blur" );
- div.trigger( "focus" );
+ div.trigger( "focusin" );
ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
$( "#widget" ).testWidget( "disable" );
ok( !div.hasClass( "ui-state-focus" ), "not focused while disabled" );
- div.trigger( "focus" );
+ div.trigger( "focusin" );
ok( !div.hasClass( "ui-state-focus" ), "can't focus while disabled" );
$( "#widget" ).testWidget( "enable" );
ok( !div.hasClass( "ui-state-focus" ), "enabling doesn't reset focus" );
- div.trigger( "focus" );
+ div.trigger( "focusin" );
ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
$( "#widget" ).testWidget( "destroy" );
ok( !div.hasClass( "ui-state-focus" ), "not focused after destroy" );
- div.trigger( "focus" );
+ div.trigger( "focusin" );
ok( !div.hasClass( "ui-state-focus" ), "event handler removed on destroy" );
});