From cdfffc702f12238752395230ccc2cf51b907002b Mon Sep 17 00:00:00 2001 From: AliagaDev Date: Wed, 17 Apr 2024 11:21:30 +0200 Subject: [PATCH] Issue #557: iWaitForAjaxToFinish fails jQuery.active internal value may have negative value in some cases causing inconsistent test results, as jquery supposedly increments the value when an ajax request starts and decrements it when it finishes, it should not influence the identification of active ajax requests --- src/Drupal/DrupalExtension/Context/MinkContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Context/MinkContext.php b/src/Drupal/DrupalExtension/Context/MinkContext.php index 52e255e7..8be3c5b7 100644 --- a/src/Drupal/DrupalExtension/Context/MinkContext.php +++ b/src/Drupal/DrupalExtension/Context/MinkContext.php @@ -147,7 +147,7 @@ function isAjaxing(instance) { return ( // Assert no AJAX request is running (via jQuery or Drupal) and no // animation is running. - (typeof jQuery === 'undefined' || jQuery.hasOwnProperty('active') === false || (jQuery.active === 0 && jQuery(':animated').length === 0)) && + (typeof jQuery === 'undefined' || jQuery.hasOwnProperty('active') === false || (jQuery.active <= 0 && jQuery(':animated').length === 0)) && d7_not_ajaxing && d8_not_ajaxing ); }());