Skip to content

Commit

Permalink
Issue jhedstrom#557: iWaitForAjaxToFinish fails
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AliagaDev committed Apr 17, 2024
1 parent 22d69d8 commit cdfffc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Drupal/DrupalExtension/Context/MinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}());
Expand Down

0 comments on commit cdfffc7

Please sign in to comment.