Skip to content
Permalink
Browse files
Trying to repair a unit
  • Loading branch information
gnarf committed Jul 25, 2012
1 parent 0f14c53 commit 81432c8
Showing 1 changed file with 23 additions and 19 deletions.
@@ -1405,25 +1405,29 @@ asyncTest( "jQuery.Animation( object, props, opts )", 4, function() {

asyncTest( "Animate Option: step: function( percent, tween )", 1, function() {
var counter = {};
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();
});
// 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 );
});

asyncTest( "Animate callbacks have correct context", 2, function() {

0 comments on commit 81432c8

Please sign in to comment.