Skip to content

Commit e7a0da6

Browse files
authored
Tests: Increase robustness of a draggable revert test
One of the changes is increasing `revertDuration` from 200 to 300. For some reason, when jQuery 3.1 is used in an iframe (which TestSwarm uses) the timings are lower than expected and `setTimeout` too slow and the check for animation happens too late. Closes gh-2230
1 parent ab2a2a9 commit e7a0da6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/unit/draggable/options.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ QUnit.test( "opacity, default, switching after initialization", function( assert
10181018
} );
10191019

10201020
QUnit.test( "revert and revertDuration", function( assert ) {
1021-
var ready = assert.async();
1021+
var ready = assert.async( 2 );
10221022
assert.expect( 7 );
10231023

10241024
var element = $( "#draggable2" ).draggable( {
@@ -1035,7 +1035,7 @@ QUnit.test( "revert and revertDuration", function( assert ) {
10351035

10361036
$( "#draggable2" ).draggable( "option", {
10371037
revert: true,
1038-
revertDuration: 200,
1038+
revertDuration: 300,
10391039
stop: function() {
10401040
ready();
10411041
}
@@ -1045,6 +1045,7 @@ QUnit.test( "revert and revertDuration", function( assert ) {
10451045
testHelper.move( element, 50, 50 );
10461046
setTimeout( function() {
10471047
assert.ok( $( "#draggable2" ).is( ":animated" ), "revert: true with revertDuration should animate" );
1048+
ready();
10481049
} );
10491050
} );
10501051

0 commit comments

Comments
 (0)