X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=test%2Funit%2Feffects.js;h=2dfe834b25778a964ab56326404a281b55f7e400;hp=3c4015aff61f5fa6f82e87b9edae7f75972244d5;hb=5646a4feee87b086fa4752373422622d54a8430d;hpb=2866f16c09cce43044d721563a7bdbd9170fb494 diff --git a/test/unit/effects.js b/test/unit/effects.js index 3c4015a..2dfe834 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -770,3 +770,33 @@ test("animate with per-property easing", function(){ }); }); + +test("hide hidden elements (bug #7141)", function() { + expect(3); + QUnit.reset(); + + var div = jQuery("
").appendTo("#main"); + equals( div.css("display"), "none", "Element is hidden by default" ); + div.hide(); + ok( !div.data("olddisplay"), "olddisplay is undefined after hiding an already-hidden element" ); + div.show(); + equals( div.css("display"), "block", "Show a double-hidden element" ); + + div.remove(); +}); + +test("hide hidden elements, with animation (bug #7141)", function() { + expect(3); + QUnit.reset(); + stop(); + + var div = jQuery("
").appendTo("#main"); + equals( div.css("display"), "none", "Element is hidden by default" ); + div.hide(1, function () { + ok( !div.data("olddisplay"), "olddisplay is undefined after hiding an already-hidden element" ); + div.show(1, function () { + equals( div.css("display"), "block", "Show a double-hidden element" ); + start(); + }); + }); +});