Skip to content

Commit 80a2612

Browse files
committed
MOBILE-4616 behat: Fix go to parent element in closest matching
1 parent e2e1792 commit 80a2612

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/testing/services/behat-dom.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,12 @@ export class TestingBehatDomUtilsService {
375375
return element;
376376
}
377377

378-
if (element === container || !element.parentElement) {
378+
const parent = this.getParentElement(element);
379+
if (element === container || !parent) {
379380
return null;
380381
}
381382

382-
return this.getClosestMatching(element.parentElement, selector, container);
383+
return this.getClosestMatching(parent, selector, container);
383384
}
384385

385386
/**

0 commit comments

Comments
 (0)