aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/effects.js
diff options
context:
space:
mode:
authorCorey Frang <gnarf@gnarf.net>2012-07-25 15:36:21 -0500
committerCorey Frang <gnarf@gnarf.net>2012-07-25 15:36:21 -0500
commitf0432d54f68c35c63573128263c85217f3cf8d69 (patch)
tree4f7a58982e913caeb913a352b63e411604d82133 /test/unit/effects.js
parent81432c883576ebccdc164704847a7b38c8513bcc (diff)
downloadjquery-f0432d54f68c35c63573128263c85217f3cf8d69.tar.gz
jquery-f0432d54f68c35c63573128263c85217f3cf8d69.zip
This should repair the unit
Diffstat (limited to 'test/unit/effects.js')
-rw-r--r--test/unit/effects.js44
1 files changed, 21 insertions, 23 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js
index a35505884..6d200b534 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -1405,29 +1405,27 @@ asyncTest( "jQuery.Animation( object, props, opts )", 4, function() {
asyncTest( "Animate Option: step: function( percent, tween )", 1, function() {
var counter = {};
- // if the animation loop is already running when we start this test, it WILL fail
- // going to try delaying 100ms to make sure any potential leftover animations are done
- setTimeout( function() {
- jQuery( "#foo" ).animate({
- prop1: 1,
- prop2: 2,
- prop3: 3
- }, {
- duration: 1,
- step: function( value, tween ) {
- var calls = counter[ tween.prop ] = counter[ tween.prop ] || [];
- calls.push( value );
- }
- }).queue( function( next ) {
- deepEqual( counter, {
- prop1: [0, 1],
- prop2: [0, 2],
- prop3: [0, 3]
- }, "Step function was called once at 0% and once at 100% for each property");
- next();
- start();
- });
- }, 100 );
+ jQuery( "#foo" ).animate({
+ prop1: 1,
+ prop2: 2,
+ prop3: 3
+ }, {
+ duration: 1,
+ step: function( value, tween ) {
+ var calls = counter[ tween.prop ] = counter[ tween.prop ] || [];
+ // in case this is called multiple times for either, lets store it in
+ // 0 or 1 in the array
+ calls[ value === 0 ? 0 : 1 ] = value;
+ }
+ }).queue( function( next ) {
+ deepEqual( counter, {
+ prop1: [0, 1],
+ prop2: [0, 2],
+ prop3: [0, 3]
+ }, "Step function was called once at 0% and once at 100% for each property");
+ next();
+ start();
+ });
});
asyncTest( "Animate callbacks have correct context", 2, function() {