aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-05-07 21:26:02 -0400
committertimmywil <tim.willison@thisismedium.com>2011-05-07 21:26:02 -0400
commit90f37aaf7aa7c6da96ab15488b63b2eb45a2e799 (patch)
tree657f42b264775c2919f0bce18903bc8c1da0e689 /test
parent8bb6e95b66413c484006288691a82c44ba50554e (diff)
downloadjquery-90f37aaf7aa7c6da96ab15488b63b2eb45a2e799.tar.gz
jquery-90f37aaf7aa7c6da96ab15488b63b2eb45a2e799.zip
Call extend on prop to avoid changing original properties so that per-property easing is not lost in multiple animations with the same props
Diffstat (limited to 'test')
-rw-r--r--test/unit/effects.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js
index 56798c3f8..ea7f4e727 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -923,13 +923,18 @@ test("jQuery.show('fast') doesn't clear radio buttons (bug #1095)", function ()
test("animate with per-property easing", function(){
- expect(3);
+ expect(5);
stop();
var data = { a:0, b:0, c:0 },
_test1_called = false,
_test2_called = false,
- _default_test_called = false;
+ _default_test_called = false,
+ props = {
+ a: [ 100, "_test1" ],
+ b: [ 100, "_test2" ],
+ c: 100
+ };
jQuery.easing["_test1"] = function(p) {
_test1_called = true;
@@ -946,16 +951,14 @@ test("animate with per-property easing", function(){
return p;
};
- jQuery(data).animate({
- a: [100, "_test1"],
- b: [100, "_test2"],
- c: 100
- }, 400, "_default_test", function(){
+ jQuery(data).animate( props, 400, "_default_test", function(){
start();
ok( _test1_called, "Easing function (_test1) called" );
ok( _test2_called, "Easing function (_test2) called" );
ok( _default_test_called, "Easing function (_default) called" );
+ equal( props.a[ 1 ], "_test1", "animate does not change original props (per-property easing would be lost)");
+ equal( props.b[ 1 ], "_test2", "animate does not change original props (per-property easing would be lost)");
});
});