X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Feffects.js;h=e96f6b6f045e66b29725841d42280a369496c599;hb=3e0cc815043c2425819743e907a0ce263a7ce164;hp=aca9263840d92d2bdfd1a21be5c77944d7f85aad;hpb=795e880bba1f7f949df58748f7fd92e50296a8f4;p=jquery.git diff --git a/test/unit/effects.js b/test/unit/effects.js index aca9263..e96f6b6 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -64,7 +64,7 @@ test("show()", function() { // #show-tests * is set display: none in CSS jQuery("#main").append('

'); - + var old = jQuery("#test-table").show().css("display") !== "table"; jQuery("#test-table").remove(); @@ -134,31 +134,35 @@ test("show(Number) - other displays", function() { // Supports #7397 test("Persist correct display value", function() { - expect(4); + expect(3); QUnit.reset(); stop(); // #show-tests * is set display: none in CSS - jQuery("#main").append('
'); - - var $span = jQuery("#show-tests span"), - orig = $span.css("display"), - num = 0; - - equal(orig, "none", "Expecting to start at display: none"); + jQuery("#main").append('
foo
'); + + var $span = jQuery("#show-tests span"), + displayNone = $span.css("display"), + display = '', num = 0; + + $span.show(); + + display = $span.css("display"); + + $span.hide(); + + $span.fadeIn(100, function() { - $span.text('Saving...').fadeIn(100, function() { + equals($span.css("display"), display, "Expecting display: " + display); - equal($span.css("display"), "block", "Expecting display: block"); + $span.fadeOut(100, function () { + + equals($span.css("display"), displayNone, "Expecting display: " + displayNone); + + $span.fadeIn(100, function() { + + equals($span.css("display"), display, "Expecting display: " + display); - $span.text('Saved!').fadeOut(100, function () { - - equal($span.css("display"), "none", "Expecting display: none"); - - $span.text('Saving...').fadeIn(100, function() { - - equal($span.css("display"), "block", "Expecting display: block"); - start(); }); }); @@ -190,7 +194,7 @@ test("animate block as inline width/height", function() { var span = jQuery("").css("display", "inline-block").appendTo("body"), expected = span.css("display"); - + span.remove(); if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) { @@ -216,7 +220,7 @@ test("animate native inline width/height", function() { var span = jQuery("").css("display", "inline-block").appendTo("body"), expected = span.css("display"); - + span.remove(); if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) { @@ -885,7 +889,7 @@ 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 () {