diff options
author | louisremi <louisremi@louisremi-laptop.(none)> | 2011-05-10 11:22:12 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2011-05-10 11:22:12 -0400 |
commit | 521ae562daa8f95def8872a55a260e9bdbc40d8b (patch) | |
tree | 1510ebd92680f03084c01abc82a2c64172576515 /test/unit/effects.js | |
parent | 304dd618b7aa17158446bedd80af330375d8d4d4 (diff) | |
parent | 966c2fe46a785a2555ec9a1048fc4a9014c40aa3 (diff) | |
download | jquery-521ae562daa8f95def8872a55a260e9bdbc40d8b.tar.gz jquery-521ae562daa8f95def8872a55a260e9bdbc40d8b.zip |
Landing pull request 374. .animate() Callbacks should fire in correct order (unit test included). Fixes #9100.
More Details:
- https://github.com/jquery/jquery/pull/374
- https://github.com/jquery/jquery/issues/9100
Diffstat (limited to 'test/unit/effects.js')
-rw-r--r-- | test/unit/effects.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js index ea7f4e727..864c4a400 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -1029,3 +1029,19 @@ test( "animate properties missing px w/ opacity as last (#9074)", 2, function() start(); }, 100); }); + +test("callbacks should fire in correct order (#9100)", function() { + stop(); + var a = 1, + cb = 0, + $lis = jQuery("<p data-operation='*2'></p><p data-operation='^2'></p>").appendTo("#qunit-fixture") + // The test will always pass if no properties are animated or if the duration is 0 + .animate({fontSize: 12}, 13, function() { + a *= jQuery(this).data("operation") === "*2" ? 2 : a; + cb++; + if ( cb === 2 ) { + equal( a, 4, "test value has been *2 and _then_ ^2"); + start(); + } + }); +}); |