X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Ffx.js;h=63a3de7a6a350341eced86f611d880169b9a9ce3;hb=7c04a64016c1f295dfdf4e731f693f8400a987bc;hp=de10acedc35668208bfc154575d457469a18ac9c;hpb=2c31a1624f72df3987cd1d0d3605c359658986e5;p=jquery.git diff --git a/test/unit/fx.js b/test/unit/fx.js index de10ace..63a3de7 100644 --- a/test/unit/fx.js +++ b/test/unit/fx.js @@ -1,5 +1,40 @@ module("fx"); +test("show()", function() { + expect(15); + var pass = true, div = jQuery("#main div"); + div.show().each(function(){ + if ( this.style.display == "none" ) pass = false; + }); + ok( pass, "Show" ); + + jQuery("#main").append('

'); + + var old = jQuery("#show-tests table").show().css("display") !== "table"; + + 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(); + equals( elem.css("display"), expected, "Show using correct display type for " + selector ); + }); +}); + test("animate(Hash, Object, Function)", function() { expect(1); stop();