aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRenato Oliveira dos Santos <ros3@cin.ufpe.br>2013-03-17 03:40:18 -0300
committerDave Methvin <dave.methvin@gmail.com>2013-04-16 23:07:39 -0400
commitea5c22ec12e6a548b1ec2d7b0dcd9f71bea8d5dd (patch)
tree2bdcad9d896f0222c6a3fdbc52c834f63bc2fcb8 /test
parent2c7b1b8502ba85320678499c8499b647c1ea82e2 (diff)
downloadjquery-ea5c22ec12e6a548b1ec2d7b0dcd9f71bea8d5dd.tar.gz
jquery-ea5c22ec12e6a548b1ec2d7b0dcd9f71bea8d5dd.zip
Fix #13483. Let slideDown() work after stop(). Close gh-1205.
Diffstat (limited to 'test')
-rw-r--r--test/unit/effects.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js
index b8e49ba45..1b2bee85a 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -2033,4 +2033,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 );
+});
+
})();