aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorBrandon Aaron <brandon.aaron@gmail.com>2007-12-08 04:54:53 +0000
committerBrandon Aaron <brandon.aaron@gmail.com>2007-12-08 04:54:53 +0000
commitb3ec8edddd9261eef490f8317144e9c68c888819 (patch)
treed58a4c915f7eff81c0da53e9f55402956672539c /test/unit
parent91f1299f68a68728467a2566a38845d82e30606f (diff)
downloadjquery-b3ec8edddd9261eef490f8317144e9c68c888819.tar.gz
jquery-b3ec8edddd9261eef490f8317144e9c68c888819.zip
show is now element aware (#960)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/core.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 7ba7eb5da..533fcef2d 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -1106,12 +1106,35 @@ test("prev([String])", function() {
});
test("show()", function() {
- expect(1);
+ expect(15);
var pass = true, div = $("div");
div.show().each(function(){
if ( this.style.display == "none" ) pass = false;
});
ok( pass, "Show" );
+
+ $("#main").append('<div id="show-tests"><div><p><a href="#"></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>');
+ var test = {
+ "div" : "block",
+ "p" : "block",
+ "a" : "inline",
+ "code" : "inline",
+ "pre" : "block",
+ "span" : "inline",
+ "table" : $.browser.msie ? "block" : "table",
+ "thead" : $.browser.msie ? "block" : "table-header-group",
+ "tbody" : $.browser.msie ? "block" : "table-row-group",
+ "tr" : $.browser.msie ? "block" : "table-row",
+ "th" : $.browser.msie ? "block" : "table-cell",
+ "td" : $.browser.msie ? "block" : "table-cell",
+ "ul" : "block",
+ "li" : $.browser.msie ? "block" : "list-item"
+ };
+
+ $.each(test, function(selector, expected) {
+ var elem = $(selector, "#show-tests").show();
+ equals( elem.css("display"), expected, "Show using correct display type for " + selector );
+ });
});
test("addClass(String)", function() {