diff --git a/.all-contributorsrc b/.all-contributorsrc
index f7ffca0b..a616a493 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -296,6 +296,15 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "wyze",
+ "name": "Neil Kistner",
+ "avatar_url": "https://avatars1.githubusercontent.com/u/186971?v=4",
+ "profile": "https://neilkistner.com/",
+ "contributions": [
+ "code"
+ ]
}
]
}
diff --git a/README.md b/README.md
index e62d73ac..71108d93 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]
@@ -324,6 +324,13 @@ Returns the element that has the matching `title` attribute.
const deleteElement = getByTitle(container, 'Delete')
```
+Will also find a `title` element within an SVG.
+
+```javascript
+//
+const closeElement = getByTitle(container, 'Close')
+```
+
### `getByValue`
```typescript
@@ -917,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") |
+| [
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") |
diff --git a/src/__tests__/element-queries.js b/src/__tests__/element-queries.js
index 1ff35674..f1168f79 100644
--- a/src/__tests__/element-queries.js
+++ b/src/__tests__/element-queries.js
@@ -146,6 +146,23 @@ test('query/get element by its title', () => {
expect(getByTitle('Delete').id).toEqual('2')
expect(queryByTitle('Delete').id).toEqual('2')
+ expect(queryByTitle('Del', {exact: false}).id).toEqual('2')
+})
+
+test('query/get title element of SVG', () => {
+ const {getByTitle, queryByTitle} = render(`
+