mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Wait for both .stop() tests to finish, don't count on timing.
This commit is contained in:
parent
e41553950d
commit
77412e0305
12
test/unit/effects.js
vendored
12
test/unit/effects.js
vendored
@ -555,11 +555,12 @@ test("stop()", function() {
|
||||
expect( 4 );
|
||||
stop();
|
||||
|
||||
var $foo = jQuery("#foo");
|
||||
var w = 0;
|
||||
var $foo = jQuery("#foo"),
|
||||
tests = 2,
|
||||
w = 0;
|
||||
|
||||
$foo.hide().css( "width", 200 )
|
||||
.animate( { "width": "show" }, 1000 );
|
||||
.animate( { "width": "show" }, 1500 );
|
||||
|
||||
setTimeout(function() {
|
||||
var nw = $foo.css("width");
|
||||
@ -572,7 +573,9 @@ test("stop()", function() {
|
||||
$foo.removeData();
|
||||
$foo.removeData(undefined, true);
|
||||
equal( nw, $foo.css("width"), "The animation didn't continue" );
|
||||
if ( --tests === 0 ) {
|
||||
start();
|
||||
}
|
||||
}, 100);
|
||||
}, 100);
|
||||
|
||||
@ -586,6 +589,9 @@ test("stop()", function() {
|
||||
equal( $two.css("opacity"), "0", "Stop does not interfere with animations on other elements (#6641)" );
|
||||
// Reset styles
|
||||
$one.add( $two ).css("opacity", "");
|
||||
if ( --tests === 0 ) {
|
||||
start();
|
||||
}
|
||||
});
|
||||
}, 50);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user