]> source.dussan.org Git - jquery.git/commitdiff
oops unit test
authorlouisremi <louisremi@louisremi-laptop.(none)>
Mon, 9 May 2011 15:46:00 +0000 (17:46 +0200)
committerlouisremi <louisremi@louisremi-laptop.(none)>
Mon, 9 May 2011 15:46:00 +0000 (17:46 +0200)
test/unit/effects.js

index d051821734763c6ea8d0f8a0c3e566cb11b2e019..f015fc91ad374de6cd7a65437c8e3206732f4dc9 100644 (file)
@@ -993,3 +993,20 @@ test("animate unit-less properties (#4966)", 2, function() {
                start();
        });
 });
+
+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() {
+                               console.log(jQuery(this).data("operation"))
+                               a *= jQuery(this).data("operation") === "*2" ? 2 : a;
+                               cb++;
+                               if ( cb === 2 ) {
+                                       equal( a, 4, "test value has been *2 and _then_ ^2");
+                                       start();
+                               }
+                       });
+});
\ No newline at end of file