the-forest/client/node_modules/@testing-library/dom/dist/get-node-text.js

13 lines
448 B
JavaScript
Raw Normal View History

2024-09-17 20:35:18 -04:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getNodeText = getNodeText;
var _helpers = require("./helpers");
function getNodeText(node) {
if (node.matches('input[type=submit], input[type=button], input[type=reset]')) {
return node.value;
}
return Array.from(node.childNodes).filter(child => child.nodeType === _helpers.TEXT_NODE && Boolean(child.textContent)).map(c => c.textContent).join('');
}