X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Ffx.js;h=6b81322e2a909f6dbd71693072bbc83908ee7b9a;hb=8356871a5522ad59cac80af2ca4695079059b97e;hp=978ef7178dc92ecfd692dd78fca2e8c662b463ca;hpb=d7d908b05a442745c1a90728805b74db0a7921cf;p=jquery.git diff --git a/test/unit/fx.js b/test/unit/fx.js index 978ef71..6b81322 100644 --- a/test/unit/fx.js +++ b/test/unit/fx.js @@ -46,6 +46,7 @@ test("animate(Hash, Object, Function)", function() { }); }); +/* // This test ends up being flaky depending upon the CPU load test("animate option (queue === false)", function () { expect(1); stop(); @@ -53,24 +54,21 @@ test("animate option (queue === false)", function () { var order = []; var $foo = jQuery("#foo"); - $foo.animate({width:'100px'}, 200, function () { + $foo.animate({width:'100px'}, 3000, function () { // should finish after unqueued animation so second order.push(2); + isSet( order, [ 1, 2 ], "Animations finished in the correct order" ); + start(); }); $foo.animate({fontSize:'2em'}, {queue:false, duration:10, complete:function () { // short duration and out of queue so should finish first order.push(1); }}); - $foo.animate({height:'100px'}, 10, function() { - // queued behind the first animation so should finish third - order.push(3); - isSet( order, [ 1, 2, 3], "Animations finished in the correct order" ); - start(); - }); }); +*/ test("animate duration 0", function() { - expect(5); + expect(7); stop(); @@ -99,7 +97,27 @@ test("animate duration 0", function() { // Failed until [6115] equals( counter, 5, "One synchronic and one asynchronic" ); start(); - }); + }); + + var $elem = jQuery("
"); + $elem.show(0, function(){ + ok(true, "Show's callback with no duration"); + }); + $elem.hide(0, function(){ + ok(true, "Show's callback with no duration"); + }); +}); + +test("animate hyphenated properties", function(){ + expect(1); + stop(); + + jQuery("#nothiddendiv") + .css("font-size", 10) + .animate({"font-size": 20}, 200, function(){ + equals( this.style.fontSize, "20px", "The font-size property was animated." ); + start(); + }); }); test("animate non-element", function(){