MDL-63977 Behat: Fix bug in 'near' calculation
parent
5958b9dc1b
commit
ae110772cf
|
@ -306,8 +306,9 @@
|
|||
var calculateNearDepth = function(node) {
|
||||
var depth = 0;
|
||||
while (node) {
|
||||
if (nearAncestors.indexOf(node) !== -1) {
|
||||
return depth;
|
||||
var ancestorDepth = nearAncestors.indexOf(node);
|
||||
if (ancestorDepth !== -1) {
|
||||
return depth + ancestorDepth;
|
||||
}
|
||||
node = node.parentNode;
|
||||
depth++;
|
||||
|
|
Loading…
Reference in New Issue