MCPcopy
hub / github.com/testing-library/dom-testing-library / computeAriaExpanded

Function computeAriaExpanded

src/role-helpers.js:302–305  ·  view source on GitHub ↗

* @param {Element} element - * @returns {boolean | undefined} - false/true if (not)expanded, undefined if not expand-able

(element)

Source from the content-addressed store, hash-verified

300 * @returns {boolean | undefined} - false/true if (not)expanded, undefined if not expand-able
301 */
302function computeAriaExpanded(element) {
303 // https://www.w3.org/TR/wai-aria-1.1/#aria-expanded
304 return checkBooleanAttribute(element, 'aria-expanded')
305}
306
307function checkBooleanAttribute(element, attribute) {
308 const attributeValue = element.getAttribute(attribute)

Callers 1

queryAllByRoleFunction · 0.90

Calls 1

checkBooleanAttributeFunction · 0.85

Tested by

no test coverage detected