X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Ffx.js;h=9b2f9d8b12de4f20bc8e414677191fc3cb1e445d;hb=3c89e38fc26ef40797b83ba8ef4f8329b08afe75;hp=c259a38965094f6c62d01eec44f12e066c466dd4;hpb=c7d640f000c6945a238aa99952b4b1b378775d7e;p=jquery.git diff --git a/test/unit/fx.js b/test/unit/fx.js index c259a38..9b2f9d8 100644 --- a/test/unit/fx.js +++ b/test/unit/fx.js @@ -41,6 +41,43 @@ test("show()", function() { }); }); +test("show(Number) - other displays", function() { + expect(15); + reset(); + stop(); + + jQuery("#main").append('

'); + + var old = jQuery("#show-tests table").show().css("display") !== "table", + num = 0; + + var test = { + "div" : "block", + "p" : "block", + "a" : "inline", + "code" : "inline", + "pre" : "block", + "span" : "inline", + "table" : old ? "block" : "table", + "thead" : old ? "block" : "table-header-group", + "tbody" : old ? "block" : "table-row-group", + "tr" : old ? "block" : "table-row", + "th" : old ? "block" : "table-cell", + "td" : old ? "block" : "table-cell", + "ul" : "block", + "li" : old ? "block" : "list-item" + }; + + jQuery.each(test, function(selector, expected) { + var elem = jQuery(selector, "#show-tests").show(1, function() { + equals( elem.css("display"), expected, "Show using correct display type for " + selector ); + if ( ++num === 15 ) { + start(); + } + }); + }); +}); + test("animate(Hash, Object, Function)", function() { expect(1); stop(); @@ -52,6 +89,15 @@ test("animate(Hash, Object, Function)", function() { }); }); +test("animate negative height", function() { + expect(1); + stop(); + jQuery("#foo").animate({ height: -100 }, 100, function() { + equals( this.offsetHeight, 0, "Verify height." ); + start(); + }); +}); + /* // This test ends up being flaky depending upon the CPU load test("animate option (queue === false)", function () { expect(1);