@testing-library/user-event
Version:
Fire events the same way the user does
17 lines (14 loc) • 420 B
JavaScript
import '../utils/dataTransfer/Clipboard.js';
import { isContentEditable } from '../utils/edit/isContentEditable.js';
import { getUIValue } from './UI.js';
function getValueOrTextContent(element) {
// istanbul ignore if
if (!element) {
return null;
}
if (isContentEditable(element)) {
return element.textContent;
}
return getUIValue(element);
}
export { getValueOrTextContent };