@testing-library/dom
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -452,3 +452,9 @@ 'use strict'; | ||
return Array.from(container.querySelectorAll('label')).filter(function (label) { | ||
return matcher(label.textContent, label, text, matchNormalizer); | ||
var textToMatch = label.textContent; // The children of a textarea are part of `textContent` as well. We | ||
// need to remove them from the string so we can match it afterwards. | ||
label.querySelectorAll('textarea').forEach(function (textarea) { | ||
textToMatch = textToMatch.replace(textarea.value, ''); | ||
}); | ||
return matcher(textToMatch, label, text, matchNormalizer); | ||
}); | ||
@@ -455,0 +461,0 @@ } |
@@ -446,3 +446,9 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
return Array.from(container.querySelectorAll('label')).filter(function (label) { | ||
return matcher(label.textContent, label, text, matchNormalizer); | ||
var textToMatch = label.textContent; // The children of a textarea are part of `textContent` as well. We | ||
// need to remove them from the string so we can match it afterwards. | ||
label.querySelectorAll('textarea').forEach(function (textarea) { | ||
textToMatch = textToMatch.replace(textarea.value, ''); | ||
}); | ||
return matcher(textToMatch, label, text, matchNormalizer); | ||
}); | ||
@@ -449,0 +455,0 @@ } |
@@ -26,3 +26,11 @@ "use strict"; | ||
}); | ||
return Array.from(container.querySelectorAll('label')).filter(label => matcher(label.textContent, label, text, matchNormalizer)); | ||
return Array.from(container.querySelectorAll('label')).filter(label => { | ||
let textToMatch = label.textContent; // The children of a textarea are part of `textContent` as well. We | ||
// need to remove them from the string so we can match it afterwards. | ||
label.querySelectorAll('textarea').forEach(textarea => { | ||
textToMatch = textToMatch.replace(textarea.value, ''); | ||
}); | ||
return matcher(textToMatch, label, text, matchNormalizer); | ||
}); | ||
} | ||
@@ -29,0 +37,0 @@ |
{ | ||
"name": "@testing-library/dom", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "Simple and complete DOM testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
<div align="center"> | ||
<h1>dom-testing-library</h1> | ||
<h1>DOM Testing Library</h1> | ||
@@ -75,3 +75,3 @@ <a href="https://www.emojione.com/emoji/1f419"> | ||
The `dom-testing-library` is a very light-weight solution for testing DOM nodes | ||
The `DOM Testing Library` is a very light-weight solution for testing DOM nodes | ||
(whether simulated with [`JSDOM`](https://github.com/jsdom/jsdom) as provided by | ||
@@ -81,3 +81,3 @@ default with [Jest][] or in the browser). The main utilities it provides involve | ||
elements on the page. In this way, the library helps ensure your tests give you | ||
confidence in your UI code. The `dom-testing-library`'s primary guiding | ||
confidence in your UI code. The `DOM Testing Library`'s primary guiding | ||
principle is: | ||
@@ -84,0 +84,0 @@ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1611972
14547