diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2012-07-25 21:58:59 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-07-25 21:58:59 -0400 |
commit | a475f1aa4dd7ac96fcd80728ce2738386778f343 (patch) | |
tree | 654caaf496395218a7fd6df9450d477e22243dd8 | |
parent | cc6c014125ad2d6c8a705f0d543069ce5802757e (diff) | |
download | jquery-a475f1aa4dd7ac96fcd80728ce2738386778f343.tar.gz jquery-a475f1aa4dd7ac96fcd80728ce2738386778f343.zip |
Pull in unit tests from gh-877, thanks @orkel!
-rw-r--r-- | test/unit/css.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index c2142052a..dca5a08e0 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -561,8 +561,10 @@ test( "show() resolves correct default display, detached nodes (#10006)", functi }); test("toggle()", function() { - expect(7); - var x = jQuery("#foo"); + expect(9); + var div, + x = jQuery("#foo"); + ok( x.is(":visible"), "is visible" ); x.toggle(); ok( x.is(":hidden"), "is hidden" ); @@ -575,7 +577,12 @@ test("toggle()", function() { ok( x.is(":hidden"), "is hidden" ); x.toggle(true); ok( x.is(":visible"), "is visible again" ); - + + div = jQuery("<div style='display:none'><div></div></div>").appendTo("#qunit-fixture"); + x = div.find("div"); + strictEqual( x.toggle().css( "display" ), "none", "is hidden" ); + strictEqual( x.toggle().css( "display" ), "block", "is visible" ); + // Ensure hide() is called when toggled (#12148) var oldHide = jQuery.fn.hide; jQuery.fn.hide = function() { @@ -584,8 +591,6 @@ test("toggle()", function() { }; x.toggle( name === "show" ); jQuery.fn.hide = oldHide; - - }); test("hide hidden elements (bug #7141)", function() { |