diff --git a/.all-contributorsrc b/.all-contributorsrc
index 076f4205..de679507 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -698,6 +698,16 @@
"contributions": [
"doc"
]
+ },
+ {
+ "login": "MarkFalconbridge",
+ "name": "MarkFalconbridge",
+ "avatar_url": "https://avatars1.githubusercontent.com/u/20678943?v=4",
+ "profile": "https://github.com/MarkFalconbridge",
+ "contributions": [
+ "bug",
+ "code"
+ ]
}
],
"contributorsPerLine": 7
diff --git a/README.md b/README.md
index 890fa52b..d6c46844 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,7 @@ 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") |
+| [
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") |
This project follows the [all-contributors][all-contributors] specification.
diff --git a/src/__tests__/render.js b/src/__tests__/render.js
index 0ffe1322..74adf5ea 100644
--- a/src/__tests__/render.js
+++ b/src/__tests__/render.js
@@ -57,14 +57,16 @@ test('returns baseElement which defaults to document.body', () => {
it('cleansup document', () => {
const spy = jest.fn()
+ const divId = 'my-div';
class Test extends React.Component {
componentWillUnmount() {
+ expect(document.getElementById(divId)).toBeInTheDocument()
spy()
}
render() {
- return
+ return
}
}
diff --git a/src/index.js b/src/index.js
index d2661920..c07bd000 100644
--- a/src/index.js
+++ b/src/index.js
@@ -78,10 +78,10 @@ function cleanup() {
// maybe one day we'll expose this (perhaps even as a utility returned by render).
// but let's wait until someone asks for it.
function cleanupAtContainer(container) {
+ ReactDOM.unmountComponentAtNode(container)
if (container.parentNode === document.body) {
document.body.removeChild(container)
}
- ReactDOM.unmountComponentAtNode(container)
mountedContainers.delete(container)
}