diff --git a/.all-contributorsrc b/.all-contributorsrc
index cbd22857..0a77c92c 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -168,9 +168,18 @@
"profile": "https://github.com/dfcook",
"contributions": [
"code",
- "doc,
+ "doc",
"test"
]
+ },
+ {
+ "login": "thchia",
+ "name": "Thomas Chia",
+ "avatar_url": "https://avatars2.githubusercontent.com/u/21194045?s=400&v=4",
+ "profile": "https://github.com/thchia",
+ "contributions": [
+ "bug"
+ ]
}
]
}
diff --git a/README.md b/README.md
index 76fb749a..7ec481f9 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
[![downloads][downloads-badge]][npmtrends]
[![MIT License][license-badge]][license]
-[](#contributors)
+[](#contributors)
[![PRs Welcome][prs-badge]][prs]
[![Code of Conduct][coc-badge]][coc]
@@ -83,7 +83,7 @@ when a real user uses it.
* [Using other assertion libraries](#using-other-assertion-libraries)
* [`TextMatch`](#textmatch)
* [`query` APIs](#query-apis)
-* [`bindElementToQueries`](#bindElementToQueries)
+* [`bindElementToQueries`](#bindelementtoqueries)
* [Debugging](#debugging)
* [Implementations](#implementations)
* [FAQ](#faq)
@@ -663,7 +663,7 @@ Thanks goes to these people ([emoji key][emojis]):
| [
Kent C. Dodds](https://kentcdodds.com)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=kentcdodds "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=kentcdodds "Documentation") [π](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=kentcdodds "Tests") | [
Ryan Castner](http://audiolion.github.io)
[π](https://github.com/kentcdodds/dom-testing-library/commits?author=audiolion "Documentation") | [
Daniel Sandiego](https://www.dnlsandiego.com)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=dnlsandiego "Code") | [
PaweΕ MikoΕajczyk](https://github.com/Miklet)
[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=Miklet "Code") | [
Alejandro ΓÑñez Ortiz](http://co.linkedin.com/in/alejandronanez/)
[π](https://github.com/kentcdodds/dom-testing-library/commits?author=alejandronanez "Documentation") | [
Matt Parrish](https://github.com/pbomb)
[π](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3Apbomb "Bug reports") [π»](https://github.com/kentcdodds/dom-testing-library/commits?author=pbomb "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=pbomb "Documentation") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=pbomb "Tests") | [
Justin Hall](https://github.com/wKovacs64)
[π¦](#platform-wKovacs64 "Packaging/porting to new platform") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [
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") |
+| [
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") |
diff --git a/src/__tests__/element-queries.js b/src/__tests__/element-queries.js
index b4de32cd..3e8f8871 100644
--- a/src/__tests__/element-queries.js
+++ b/src/__tests__/element-queries.js
@@ -33,6 +33,21 @@ test('get throws a useful error message', () => {
expect(() => getByAltText('LucyRicardo')).toThrowErrorMatchingSnapshot()
})
+test('can get elements by matching their text content', () => {
+ const {queryByText} = render(`
+