]> source.dussan.org Git - jquery.git/commitdiff
Ref #13483: Cherry-pick tests from master ea5c22ec12e6a548b1ec2d7b0dcd9f71bea8d5dd
authorRenato Oliveira dos Santos <ros3@cin.ufpe.br>
Sun, 17 Mar 2013 06:40:18 +0000 (03:40 -0300)
committerRichard Gibson <richard.gibson@gmail.com>
Mon, 13 May 2013 23:13:14 +0000 (19:13 -0400)
AUTHORS.txt
test/unit/effects.js

index 6ec40764aab02f941c8d73631207920b37922381..5cfbb1465df39351c402043accb79d6440c691c3 100644 (file)
@@ -166,3 +166,4 @@ Michał Gołębiowski <m.goleb@gmail.com>
 Brandon Johnson <bjohn465+github@gmail.com>
 Jason Bedard <jason+jquery@jbedard.ca>
 Kyle Robinson Young <kyle@dontkry.com>
+Renato Oliveira dos Santos <ros3@cin.ufpe.br>
index c98ab586ed9214ce415be9b5281863b885aba1b5..f276ac3bab6df18f329dba41ec5a3b58d5c1e993 100644 (file)
@@ -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( "<ul style='height: 100px;display: block'></ul>" ),
+               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( "<ul style='height: 100px;display: block; opacity: 1'></ul>" ),
+               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 );
+});
+
 })();