diff options
Diffstat (limited to 'tests/unit/spinner')
-rw-r--r-- | tests/unit/spinner/core.js | 8 | ||||
-rw-r--r-- | tests/unit/spinner/events.js | 24 | ||||
-rw-r--r-- | tests/unit/spinner/options.js | 4 |
3 files changed, 18 insertions, 18 deletions
diff --git a/tests/unit/spinner/core.js b/tests/unit/spinner/core.js index aabfd7aa5..2dc118666 100644 --- a/tests/unit/spinner/core.js +++ b/tests/unit/spinner/core.js @@ -114,7 +114,7 @@ asyncTest( "blur input while spinning with UP", function() { value = element.val(); ok( value > 11, "repeating while key is down" ); - element.bind( "blur", function() { + element.on( "blur", function() { value = element.val(); setTimeout( step3, 750 ); })[ 0 ].blur(); @@ -225,16 +225,16 @@ test( "ARIA attributes", function() { test( "focus text field when pressing button", function() { expect( 2 ); var element = $( "#spin" ).spinner(); - $( "body" ).focus(); + $( "body" ).trigger( "focus" ); ok( element[ 0 ] !== document.activeElement, "not focused before" ); - element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown(); + element.spinner( "widget" ).find( ".ui-spinner-up" ).trigger( "mousedown" ); ok( element[ 0 ] === document.activeElement, "focused after" ); }); test( "don't clear invalid value on blur", function() { expect( 1 ); var element = $( "#spin" ).spinner(); - element.focus().val( "a" ).blur(); + element.trigger( "focus" ).val( "a" ).trigger( "blur" ); equal( element.val(), "a" ); }); diff --git a/tests/unit/spinner/events.js b/tests/unit/spinner/events.js index a837f47c9..14445f48e 100644 --- a/tests/unit/spinner/events.js +++ b/tests/unit/spinner/events.js @@ -29,9 +29,9 @@ test( "start", function() { simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); shouldStart( true, "button up" ); - element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldStart( true, "button down" ); - element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldStart( true, "stepUp" ); element.spinner( "stepUp" ); @@ -68,9 +68,9 @@ test( "spin", function() { simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); shouldSpin( true, "button up" ); - element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldSpin( true, "button down" ); - element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldSpin( true, "stepUp" ); element.spinner( "stepUp" ); @@ -107,9 +107,9 @@ test( "stop", function() { simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); shouldStop( true, "button up" ); - element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldStop( true, "button down" ); - element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldStop( true, "stepUp" ); element.spinner( "stepUp" ); @@ -200,7 +200,7 @@ asyncTest( "change", function() { shouldChange( false, "blur after many keys, same final value" ); shouldChange( false, "button up, before blur" ); - element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldChange( true, "blur after button up" ); }, step7 ); } @@ -208,7 +208,7 @@ asyncTest( "change", function() { function step7() { focusWrap(function() { shouldChange( false, "button down, before blur" ); - element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldChange( true, "blur after button down" ); }, step8 ); } @@ -216,10 +216,10 @@ asyncTest( "change", function() { function step8() { focusWrap(function() { shouldChange( false, "many buttons, same final value, before blur" ); - element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); - element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); - element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); - element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" ); + element.spinner( "widget" ).find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" ); + element.spinner( "widget" ).find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" ); + element.spinner( "widget" ).find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" ); shouldChange( false, "blur after many buttons, same final value" ); }, step9 ); } diff --git a/tests/unit/spinner/options.js b/tests/unit/spinner/options.js index f8d9ad396..fa57e6096 100644 --- a/tests/unit/spinner/options.js +++ b/tests/unit/spinner/options.js @@ -181,7 +181,7 @@ test( "max", function() { element.spinner( "value", 1000 ); equal( element.val(), 100, "max constrained in value method" ); - element.val( 1000 ).blur(); + element.val( 1000 ).trigger( "blur" ); equal( element.val(), 1000, "max not constrained if manual entry" ); }); @@ -209,7 +209,7 @@ test( "min", function() { element.spinner( "value", -1000 ); equal( element.val(), -100, "min constrained in value method" ); - element.val( -1000 ).blur(); + element.val( -1000 ).trigger( "blur" ); equal( element.val(), -1000, "min not constrained if manual entry" ); }); |