aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2024-04-12 15:23:05 +0200
committerGitHub <noreply@github.com>2024-04-12 15:23:05 +0200
commite7a0da63eabec24120223e947a9d14c648c52d9e (patch)
tree9098eef01ad42e9a046f2e10da01b216263d66e7 /tests
parentab2a2a973e1f49e68d73b8afd7ffa4698bd26962 (diff)
downloadjquery-ui-e7a0da63eabec24120223e947a9d14c648c52d9e.tar.gz
jquery-ui-e7a0da63eabec24120223e947a9d14c648c52d9e.zip
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
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/draggable/options.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unit/draggable/options.js b/tests/unit/draggable/options.js
index 499454a65..40a36ba67 100644
--- a/tests/unit/draggable/options.js
+++ b/tests/unit/draggable/options.js
@@ -1018,7 +1018,7 @@ QUnit.test( "opacity, default, switching after initialization", function( assert
} );
QUnit.test( "revert and revertDuration", function( assert ) {
- var ready = assert.async();
+ var ready = assert.async( 2 );
assert.expect( 7 );
var element = $( "#draggable2" ).draggable( {
@@ -1035,7 +1035,7 @@ QUnit.test( "revert and revertDuration", function( assert ) {
$( "#draggable2" ).draggable( "option", {
revert: true,
- revertDuration: 200,
+ revertDuration: 300,
stop: function() {
ready();
}
@@ -1045,6 +1045,7 @@ QUnit.test( "revert and revertDuration", function( assert ) {
testHelper.move( element, 50, 50 );
setTimeout( function() {
assert.ok( $( "#draggable2" ).is( ":animated" ), "revert: true with revertDuration should animate" );
+ ready();
} );
} );