diff --git a/.all-contributorsrc b/.all-contributorsrc
index de679507..027204fd 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -708,6 +708,16 @@
"bug",
"code"
]
+ },
+ {
+ "login": "viniciusavieira",
+ "name": "Vinicius",
+ "avatar_url": "https://avatars0.githubusercontent.com/u/2073019?v=4",
+ "profile": "https://github.com/viniciusavieira",
+ "contributions": [
+ "doc",
+ "example"
+ ]
}
],
"contributorsPerLine": 7
diff --git a/README.md b/README.md
index d6c46844..234eb7cc 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ practices.
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]
[![MIT License][license-badge]][license]
-[](#contributors)
+[](#contributors)
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
[![Join the community on Spectrum][spectrum-badge]][spectrum]
@@ -221,7 +221,8 @@ Thanks goes to these people ([emoji key][emojis]):
| [
Michiel Nuyts](https://github.com/Michielnuyts)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=Michielnuyts "Documentation") | [
Joe Ng'ethe](https://github.com/joeynimu)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=joeynimu "Code") [π](https://github.com/kentcdodds/react-testing-library/commits?author=joeynimu "Documentation") | [
Kate](https://github.com/Enikol)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=Enikol "Documentation") | [
Sean](http://www.seanrparker.com)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=SeanRParker "Documentation") | [
James Long](http://jlongster.com)
[π€](#ideas-jlongster "Ideas, Planning, & Feedback") [π¦](#platform-jlongster "Packaging/porting to new platform") | [
Herb Hagely](https://github.com/hhagely)
[π‘](#example-hhagely "Examples") | [
Alex Wendte](http://www.wendtedesigns.com/)
[π‘](#example-themostcolm "Examples") |
| [
Monica Powell](http://www.aboutmonica.com)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=M0nica "Documentation") | [
Vitaly Sivkov](http://sivkoff.com)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=sivkoff "Code") | [
Weyert de Boer](https://github.com/weyert)
[π€](#ideas-weyert "Ideas, Planning, & Feedback") [π](#review-weyert "Reviewed Pull Requests") | [
EstebanMarin](https://github.com/EstebanMarin)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=EstebanMarin "Documentation") | [
Victor Martins](https://github.com/vctormb)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=vctormb "Documentation") | [
Royston Shufflebotham](https://github.com/RoystonS)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3ARoystonS "Bug reports") [π](https://github.com/kentcdodds/react-testing-library/commits?author=RoystonS "Documentation") [π‘](#example-RoystonS "Examples") | [
chrbala](https://github.com/chrbala)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=chrbala "Code") |
| [
Donavon West](http://donavon.com)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=donavon "Code") [π](https://github.com/kentcdodds/react-testing-library/commits?author=donavon "Documentation") [π€](#ideas-donavon "Ideas, Planning, & Feedback") [β οΈ](https://github.com/kentcdodds/react-testing-library/commits?author=donavon "Tests") | [
Richard Maisano](https://github.com/maisano)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=maisano "Code") | [
Marco Biedermann](https://www.marcobiedermann.com)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=marcobiedermann "Code") [π§](#maintenance-marcobiedermann "Maintenance") [β οΈ](https://github.com/kentcdodds/react-testing-library/commits?author=marcobiedermann "Tests") | [
Alex Zherdev](https://github.com/alexzherdev)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3Aalexzherdev "Bug reports") [π»](https://github.com/kentcdodds/react-testing-library/commits?author=alexzherdev "Code") | [
AndrΓ© Matulionis dos Santos](https://twitter.com/Andrewmat)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=Andrewmat "Code") [π‘](#example-Andrewmat "Examples") [β οΈ](https://github.com/kentcdodds/react-testing-library/commits?author=Andrewmat "Tests") | [
Daniel K.](https://github.com/FredyC)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3AFredyC "Bug reports") [π»](https://github.com/kentcdodds/react-testing-library/commits?author=FredyC "Code") [π€](#ideas-FredyC "Ideas, Planning, & Feedback") [β οΈ](https://github.com/kentcdodds/react-testing-library/commits?author=FredyC "Tests") | [
mohamedmagdy17593](https://github.com/mohamedmagdy17593)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=mohamedmagdy17593 "Code") |
-| [
Loren βΊοΈ](http://lorensr.me)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=lorensr "Documentation") | [
MarkFalconbridge](https://github.com/MarkFalconbridge)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3AMarkFalconbridge "Bug reports") [π»](https://github.com/kentcdodds/react-testing-library/commits?author=MarkFalconbridge "Code") |
+| [
Loren βΊοΈ](http://lorensr.me)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=lorensr "Documentation") | [
MarkFalconbridge](https://github.com/MarkFalconbridge)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3AMarkFalconbridge "Bug reports") [π»](https://github.com/kentcdodds/react-testing-library/commits?author=MarkFalconbridge "Code") | [
Vinicius](https://github.com/viniciusavieira)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=viniciusavieira "Documentation") [π‘](#example-viniciusavieira "Examples") |
+
This project follows the [all-contributors][all-contributors] specification.
diff --git a/examples/__tests__/react-intl.js b/examples/__tests__/react-intl.js
new file mode 100644
index 00000000..48fe0e0f
--- /dev/null
+++ b/examples/__tests__/react-intl.js
@@ -0,0 +1,45 @@
+import React from 'react'
+import 'jest-dom/extend-expect'
+import {render, cleanup, getByTestId} from 'react-testing-library'
+import {IntlProvider, FormattedDate} from 'react-intl'
+import IntlPolyfill from 'intl'
+import 'intl/locale-data/jsonp/pt'
+
+const setupTests = () => {
+ // Test enviroment run as server enviroment and should have polyfill to locale
+ // https://formatjs.io/guides/runtime-environments/#server
+ if (global.Intl) {
+ Intl.NumberFormat = IntlPolyfill.NumberFormat
+ Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat
+ } else {
+ global.Intl = require('intl')
+ }
+}
+
+const FormatDateView = () => {
+ return (
+
+
+
+ )
+}
+
+const renderWithReactIntl = component => {
+ return {
+ ...render({component}),
+ }
+}
+
+setupTests()
+afterEach(cleanup)
+
+test('it should render FormattedDate and have a formated pt date', () => {
+ const {container} = renderWithReactIntl()
+ expect(getByTestId(container, 'date-display')).toHaveTextContent('11/03/2019')
+})
diff --git a/package.json b/package.json
index 54f531f1..8220dcbe 100644
--- a/package.json
+++ b/package.json
@@ -52,11 +52,13 @@
"axios": "^0.18.0",
"eslint-import-resolver-jest": "^2.1.1",
"history": "^4.7.2",
+ "intl": "^1.2.5",
"jest-dom": "3.0.1",
"jest-in-case": "^1.0.2",
"kcd-scripts": "0.49.0",
"react": "^16.8.0",
"react-dom": "^16.8.0",
+ "react-intl": "^2.8.0",
"react-redux": "6.0.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",