diff --git a/.all-contributorsrc b/.all-contributorsrc index d1adec87..bf091394 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -188,6 +188,15 @@ "contributions": [ "code" ] + }, + { + "login": "lourenci", + "name": "Leandro Lourenci", + "avatar_url": "https://avatars3.githubusercontent.com/u/2339362?v=4", + "profile": "https://blog.lourenci.com/", + "contributions": [ + "bug" + ] } ] } diff --git a/README.md b/README.md index e07bc3ef..8a027cf4 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-18-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors) [![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] @@ -241,9 +241,13 @@ An element is visible if **all** the following conditions are met: ```html
Zero Opacity Example
-
Visibility Hidden Example
+
+ Visibility Hidden Example +
Display None Example
-
Hidden Parent Example
+
+ Hidden Parent Example +
Visible Example
``` @@ -403,7 +407,9 @@ does not have any classes. #### Examples ```html - + ``` @@ -722,7 +728,7 @@ Thanks goes to these people ([emoji key][emojis]): | [
Kent C. Dodds](https://kentcdodds.com)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=kentcdodds "Code") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=kentcdodds "Documentation") [πŸš‡](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/gnapse/jest-dom/commits?author=kentcdodds "Tests") | [
Ryan Castner](http://audiolion.github.io)
[πŸ“–](https://github.com/gnapse/jest-dom/commits?author=audiolion "Documentation") | [
Daniel Sandiego](https://www.dnlsandiego.com)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=dnlsandiego "Code") | [
PaweΕ‚ MikoΕ‚ajczyk](https://github.com/Miklet)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=Miklet "Code") | [
Alejandro ÑÑñez Ortiz](http://co.linkedin.com/in/alejandronanez/)
[πŸ“–](https://github.com/gnapse/jest-dom/commits?author=alejandronanez "Documentation") | [
Matt Parrish](https://github.com/pbomb)
[πŸ›](https://github.com/gnapse/jest-dom/issues?q=author%3Apbomb "Bug reports") [πŸ’»](https://github.com/gnapse/jest-dom/commits?author=pbomb "Code") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=pbomb "Documentation") [⚠️](https://github.com/gnapse/jest-dom/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/gnapse/jest-dom/commits?author=antoaravinth "Code") [⚠️](https://github.com/gnapse/jest-dom/commits?author=antoaravinth "Tests") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=antoaravinth "Documentation") | [
Jonah Moses](https://github.com/JonahMoses)
[πŸ“–](https://github.com/gnapse/jest-dom/commits?author=JonahMoses "Documentation") | [
Łukasz Gandecki](http://team.thebrain.pro)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=lgandecki "Code") [⚠️](https://github.com/gnapse/jest-dom/commits?author=lgandecki "Tests") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=lgandecki "Documentation") | [
Ivan Babak](https://sompylasar.github.io)
[πŸ›](https://github.com/gnapse/jest-dom/issues?q=author%3Asompylasar "Bug reports") [πŸ€”](#ideas-sompylasar "Ideas, Planning, & Feedback") | [
Jesse Day](https://github.com/jday3)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=jday3 "Code") | [
Ernesto GarcΓ­a](http://gnapse.github.io)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=gnapse "Code") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=gnapse "Documentation") [⚠️](https://github.com/gnapse/jest-dom/commits?author=gnapse "Tests") | [
Mark Volkmann](http://ociweb.com/mark/)
[πŸ›](https://github.com/gnapse/jest-dom/issues?q=author%3Amvolkmann "Bug reports") [πŸ’»](https://github.com/gnapse/jest-dom/commits?author=mvolkmann "Code") | -| [
smacpherson64](https://github.com/smacpherson64)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=smacpherson64 "Code") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=smacpherson64 "Documentation") [⚠️](https://github.com/gnapse/jest-dom/commits?author=smacpherson64 "Tests") | [
John Gozde](https://github.com/jgoz)
[πŸ›](https://github.com/gnapse/jest-dom/issues?q=author%3Ajgoz "Bug reports") [πŸ’»](https://github.com/gnapse/jest-dom/commits?author=jgoz "Code") | [
Iwona](https://github.com/callada)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=callada "Code") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=callada "Documentation") [⚠️](https://github.com/gnapse/jest-dom/commits?author=callada "Tests") | [
Lewis](https://github.com/6ewis)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=6ewis "Code") | +| [
smacpherson64](https://github.com/smacpherson64)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=smacpherson64 "Code") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=smacpherson64 "Documentation") [⚠️](https://github.com/gnapse/jest-dom/commits?author=smacpherson64 "Tests") | [
John Gozde](https://github.com/jgoz)
[πŸ›](https://github.com/gnapse/jest-dom/issues?q=author%3Ajgoz "Bug reports") [πŸ’»](https://github.com/gnapse/jest-dom/commits?author=jgoz "Code") | [
Iwona](https://github.com/callada)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=callada "Code") [πŸ“–](https://github.com/gnapse/jest-dom/commits?author=callada "Documentation") [⚠️](https://github.com/gnapse/jest-dom/commits?author=callada "Tests") | [
Lewis](https://github.com/6ewis)
[πŸ’»](https://github.com/gnapse/jest-dom/commits?author=6ewis "Code") | [
Leandro Lourenci](https://blog.lourenci.com/)
[πŸ›](https://github.com/gnapse/jest-dom/issues?q=author%3Alourenci "Bug reports") | diff --git a/src/__tests__/to-have-text-content.js b/src/__tests__/to-have-text-content.js index 62c572f1..41d8b777 100644 --- a/src/__tests__/to-have-text-content.js +++ b/src/__tests__/to-have-text-content.js @@ -73,4 +73,13 @@ describe('.toHaveTextContent', () => { const {container} = render(``) expect(container.querySelector('span')).toHaveTextContent('') }) + + test('is case-sensitive', () => { + const {container} = render('Sensitive text') + + expect(container.querySelector('span')).toHaveTextContent('Sensitive text') + expect(container.querySelector('span')).not.toHaveTextContent( + 'sensitive text', + ) + }) }) diff --git a/src/utils.js b/src/utils.js index e54f7149..bc5420b3 100644 --- a/src/utils.js +++ b/src/utils.js @@ -116,7 +116,7 @@ function matches(textToMatch, matcher) { if (matcher instanceof RegExp) { return matcher.test(textToMatch) } else { - return textToMatch.toLowerCase().includes(String(matcher).toLowerCase()) + return textToMatch.includes(String(matcher)) } }