@testing-library/dom
Advanced tools
Comparing version 8.20.0 to 9.0.0-alpha.1
@@ -32,4 +32,3 @@ "use strict"; | ||
if (element.labels !== undefined) { | ||
var _labels; | ||
return (_labels = element.labels) != null ? _labels : []; | ||
return element.labels ?? []; | ||
} | ||
@@ -36,0 +35,0 @@ if (!isLabelable(element)) return []; |
@@ -150,3 +150,2 @@ "use strict"; | ||
function makeRoleSelector(role, exact, customNormalizer) { | ||
var _roleElements$get; | ||
if (typeof role !== 'string') { | ||
@@ -157,3 +156,3 @@ // For non-string role parameters we can not determine the implicitRoleSelectors. | ||
const explicitRoleSelector = exact && !customNormalizer ? `*[role~="${role}"]` : '*[role]'; | ||
const roleRelations = (_roleElements$get = _ariaQuery.roleElements.get(role)) != null ? _roleElements$get : new Set(); | ||
const roleRelations = _ariaQuery.roleElements.get(role) ?? new Set(); | ||
const implicitRoleSelectors = new Set(Array.from(roleRelations).map(({ | ||
@@ -160,0 +159,0 @@ name |
@@ -48,3 +48,3 @@ "use strict"; | ||
const isNormalizedDifferent = normalizedText !== text.toString(); | ||
const isCustomSelector = (selector != null ? selector : '*') !== '*'; | ||
const isCustomSelector = (selector ?? '*') !== '*'; | ||
return `Unable to find an element with the text: ${isNormalizedDifferent ? `${normalizedText} (normalized from '${text}')` : text}${isCustomSelector ? `, which matches selector '${selector}'` : ''}. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.`; | ||
@@ -51,0 +51,0 @@ }; |
@@ -260,5 +260,4 @@ "use strict"; | ||
function computeAriaCurrent(element) { | ||
var _ref, _checkBooleanAttribut; | ||
// https://www.w3.org/TR/wai-aria-1.1/#aria-current | ||
return (_ref = (_checkBooleanAttribut = checkBooleanAttribute(element, 'aria-current')) != null ? _checkBooleanAttribut : element.getAttribute('aria-current')) != null ? _ref : false; | ||
return checkBooleanAttribute(element, 'aria-current') ?? element.getAttribute('aria-current') ?? false; | ||
} | ||
@@ -265,0 +264,0 @@ |
@@ -62,3 +62,3 @@ "use strict"; | ||
function getSuggestedQuery(element, variant = 'get', method) { | ||
var _element$getAttribute, _getImplicitAriaRoles; | ||
var _getImplicitAriaRoles; | ||
// don't create suggestions for script and style elements | ||
@@ -70,3 +70,3 @@ if (element.matches((0, _config.getConfig)().defaultIgnore)) { | ||
//We prefer to suggest something else if the role is generic | ||
const role = (_element$getAttribute = element.getAttribute('role')) != null ? _element$getAttribute : (_getImplicitAriaRoles = (0, _roleHelpers.getImplicitAriaRoles)(element)) == null ? void 0 : _getImplicitAriaRoles[0]; | ||
const role = element.getAttribute('role') ?? ((_getImplicitAriaRoles = (0, _roleHelpers.getImplicitAriaRoles)(element)) == null ? void 0 : _getImplicitAriaRoles[0]); | ||
if (role !== 'generic' && canSuggest('Role', method, role)) { | ||
@@ -73,0 +73,0 @@ return makeSuggestion('Role', element, role, { |
{ | ||
"name": "@testing-library/dom", | ||
"version": "8.20.0", | ||
"version": "9.0.0-alpha.1", | ||
"description": "Simple and complete DOM testing utilities that encourage good testing practices.", | ||
@@ -24,3 +24,3 @@ "main": "dist/index.js", | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=14" | ||
}, | ||
@@ -44,3 +44,3 @@ "browserslist": [ | ||
"samsung 16.0", | ||
"node 12.0" | ||
"node 14.0" | ||
], | ||
@@ -47,0 +47,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
2920173
25064
1
0