@testing-library/user-event
Version:
Fire events the same way the user does
17 lines (13 loc) • 384 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function isDescendantOrSelf(potentialDescendant, potentialAncestor) {
let el = potentialDescendant;
do {
if (el === potentialAncestor) {
return true;
}
el = el.parentElement;
}while (el)
return false;
}
exports.isDescendantOrSelf = isDescendantOrSelf;