11import React from 'react'
22import ReactDOM from 'react-dom'
3- import { render , cleanup } from '../'
3+ import { render } from '../'
44
55test ( 'renders div into document' , ( ) => {
66 const ref = React . createRef ( )
@@ -52,28 +52,7 @@ test('returns baseElement which defaults to document.body', () => {
5252 expect ( baseElement ) . toBe ( document . body )
5353} )
5454
55- it ( 'cleansup document' , ( ) => {
56- const spy = jest . fn ( )
57- const divId = 'my-div'
58-
59- class Test extends React . Component {
60- componentWillUnmount ( ) {
61- expect ( document . getElementById ( divId ) ) . toBeInTheDocument ( )
62- spy ( )
63- }
64-
65- render ( ) {
66- return < div id = { divId } />
67- }
68- }
69-
70- render ( < Test /> )
71- cleanup ( )
72- expect ( document . body . innerHTML ) . toBe ( '' )
73- expect ( spy ) . toHaveBeenCalledTimes ( 1 )
74- } )
75-
76- it ( 'supports fragments' , ( ) => {
55+ test ( 'supports fragments' , ( ) => {
7756 class Test extends React . Component {
7857 render ( ) {
7958 return (
@@ -86,8 +65,6 @@ it('supports fragments', () => {
8665
8766 const { asFragment} = render ( < Test /> )
8867 expect ( asFragment ( ) ) . toMatchSnapshot ( )
89- cleanup ( )
90- expect ( document . body . innerHTML ) . toBe ( '' )
9168} )
9269
9370test ( 'renders options.wrapper around node' , ( ) => {
0 commit comments