diff --git a/.all-contributorsrc b/.all-contributorsrc
index a616a493..ac7bafbc 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -305,6 +305,15 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "bdchauvette",
+ "name": "Ben Chauvette",
+ "avatar_url": "https://avatars3.githubusercontent.com/u/1448597?v=4",
+ "profile": "http://bdchauvette.net/",
+ "contributions": [
+ "code"
+ ]
}
]
}
diff --git a/.size-snapshot.json b/.size-snapshot.json
index 0df0ea7d..87faf7e0 100644
--- a/.size-snapshot.json
+++ b/.size-snapshot.json
@@ -1,7 +1,7 @@
{
"dist/dom-testing-library.umd.js": {
- "bundled": 108613,
- "minified": 48203,
- "gzipped": 14777
+ "bundled": 111046,
+ "minified": 49098,
+ "gzipped": 14989
}
}
diff --git a/README.md b/README.md
index 71108d93..5075177f 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
[![downloads][downloads-badge]][npmtrends]
[![MIT License][license-badge]][license]
-[![All Contributors](https://img.shields.io/badge/all_contributors-30-orange.svg?style=flat-square)](#contributors)
+[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs]
[![Code of Conduct][coc-badge]][coc]
@@ -924,7 +924,7 @@ Thanks goes to these people ([emoji key][emojis]):
| [
Anto Aravinth](https://github.com/antoaravinth)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=antoaravinth "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=antoaravinth "Tests") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=antoaravinth "Documentation") | [
Jonah Moses](https://github.com/JonahMoses)
[π](https://github.com/kentcdodds/dom-testing-library/commits?author=JonahMoses "Documentation") | [
Εukasz Gandecki](http://team.thebrain.pro)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=lgandecki "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=lgandecki "Tests") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=lgandecki "Documentation") | [
Ivan Babak](https://sompylasar.github.io)
[π](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3Asompylasar "Bug reports") [π€](#ideas-sompylasar "Ideas, Planning, & Feedback") [π»](https://github.com/kentcdodds/dom-testing-library/commits?author=sompylasar "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=sompylasar "Documentation") | [
Jesse Day](https://github.com/jday3)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=jday3 "Code") | [
Ernesto GarcΓa](http://gnapse.github.io)
[π¬](#question-gnapse "Answering Questions") [π»](https://github.com/kentcdodds/dom-testing-library/commits?author=gnapse "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=gnapse "Documentation") | [
Josef Maxx Blake](http://jomaxx.com)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=jomaxx "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=jomaxx "Documentation") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=jomaxx "Tests") |
| [
Alex Cook](https://github.com/alecook)
[π](https://github.com/kentcdodds/dom-testing-library/commits?author=alecook "Documentation") [π‘](#example-alecook "Examples") | [
Daniel Cook](https://github.com/dfcook)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=dfcook "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=dfcook "Documentation") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=dfcook "Tests") | [
Thomas Chia](https://github.com/thchia)
[π](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3Athchia "Bug reports") [π»](https://github.com/kentcdodds/dom-testing-library/commits?author=thchia "Code") | [
Tim Deschryver](https://github.com/tdeschryver)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=tdeschryver "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=tdeschryver "Tests") | [
Alex Krolick](https://alexkrolick.com)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=alexkrolick "Code") | [
Maddi Joyce](http://www.maddijoyce.com)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=maddijoyce "Code") | [
Peter Kamps](https://github.com/npeterkamps)
[π](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3Anpeterkamps "Bug reports") [π»](https://github.com/kentcdodds/dom-testing-library/commits?author=npeterkamps "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=npeterkamps "Tests") |
| [
Jonathan Stoye](http://jonathanstoye.de)
[π](https://github.com/kentcdodds/dom-testing-library/commits?author=JonathanStoye "Documentation") | [
Sanghyeon Lee](https://github.com/yongdamsh)
[π‘](#example-yongdamsh "Examples") | [
Justice Mba ](https://github.com/Dajust)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=Dajust "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=Dajust "Documentation") [π€](#ideas-Dajust "Ideas, Planning, & Feedback") | [
Wayne Crouch](https://github.com/wgcrouch)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=wgcrouch "Code") | [
Ben Elliott](http://benjaminelliott.co.uk)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=benelliott "Code") | [
Ruben Costa](http://nuances.co)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=rubencosta "Code") | [
Robert Smith](http://rbrtsmith.com/)
[π](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3Arbrtsmith "Bug reports") [π€](#ideas-rbrtsmith "Ideas, Planning, & Feedback") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=rbrtsmith "Documentation") |
-| [
dadamssg](https://github.com/dadamssg)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=dadamssg "Code") | [
Neil Kistner](https://neilkistner.com/)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=wyze "Code") |
+| [
dadamssg](https://github.com/dadamssg)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=dadamssg "Code") | [
Neil Kistner](https://neilkistner.com/)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=wyze "Code") | [
Ben Chauvette](http://bdchauvette.net/)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=bdchauvette "Code") |
diff --git a/src/__tests__/element-queries.js b/src/__tests__/element-queries.js
index f1168f79..f392741d 100644
--- a/src/__tests__/element-queries.js
+++ b/src/__tests__/element-queries.js
@@ -56,6 +56,18 @@ test('can get elements by matching their text content', () => {
expect(queryByText('Step 1 of 4')).toBeTruthy()
})
+test('can get elements by matching their text across adjacent text nodes', () => {
+ const textDiv = document.createElement('div')
+ const textNodeContent = ['Β£', '24', '.', '99']
+ textNodeContent
+ .map(text => document.createTextNode(text))
+ .forEach(textNode => textDiv.appendChild(textNode))
+
+ const {container, queryByText} = render('