From: Renato Oliveira dos Santos Date: Sun, 17 Mar 2013 06:40:18 +0000 (-0300) Subject: Ref #13483: Cherry-pick tests from master ea5c22ec12e6a548b1ec2d7b0dcd9f71bea8d5dd X-Git-Tag: 1.10.0~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e0f59600a4710a6907ce715139201f05a7cb0903;p=jquery.git Ref #13483: Cherry-pick tests from master ea5c22ec12e6a548b1ec2d7b0dcd9f71bea8d5dd --- diff --git a/AUTHORS.txt b/AUTHORS.txt index 6ec40764a..5cfbb1465 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -166,3 +166,4 @@ Michał Gołębiowski Brandon Johnson Jason Bedard Kyle Robinson Young +Renato Oliveira dos Santos diff --git a/test/unit/effects.js b/test/unit/effects.js index c98ab586e..f276ac3ba 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -2071,4 +2071,64 @@ test( ".finish() calls finish of custom queue functions", function() { div.remove(); }); +asyncTest( "slideDown() after stop() (#13483)", 2, function() { + var ul = jQuery( "
    " ), + origHeight = ul.height(); + + // First test. slideUp() -> stop() in the middle -> slideDown() until the end + ul.slideUp( 1000 ); + setTimeout( function() { + ul.stop( true ); + ul.slideDown( 1, function() { + equal( ul.height(), origHeight, "slideDown() after interrupting slideUp() with stop(). Height must be in original value" ); + + // Second test. slideDown() -> stop() in the middle -> slideDown() until the end + ul.slideUp( 1, function() { + ul.slideDown( 1000 ); + setTimeout( function() { + ul.stop( true ); + ul.slideDown( 1, function() { + equal( ul.height(), origHeight, "slideDown() after interrupting slideDown() with stop(). Height must be in original value" ); + + // Cleanup + ul.remove(); + start(); + }); + }, 500 ); + }); + + }); + }, 500 ); +}); + +asyncTest( "fadeIn() after stop() (related to #13483)", 2, function() { + var ul = jQuery( "
      " ), + origOpacity = ul.css( "opacity" ); + + // First test. fadeOut() -> stop() in the middle -> fadeIn() until the end + ul.fadeOut( 1000 ); + setTimeout( function() { + ul.stop( true ); + ul.fadeIn( 1, function() { + equal( ul.css( "opacity" ), origOpacity, "fadeIn() after interrupting fadeOut() with stop(). Opacity must be in original value" ); + + // Second test. fadeIn() -> stop() in the middle -> fadeIn() until the end + ul.fadeOut( 1, function() { + ul.fadeIn( 1000 ); + setTimeout( function() { + ul.stop( true ); + ul.fadeIn( 1, function() { + equal( ul.css("opacity"), origOpacity, "fadeIn() after interrupting fadeIn() with stop(). Opacity must be in original value" ); + + // Cleanup + ul.remove(); + start(); + }); + }, 500 ); + }); + + }); + }, 500 ); +}); + })();