1
1
import React from 'react'
2
2
import ReactDOM from 'react-dom'
3
- import { render , cleanup } from '../'
3
+ import { render } from '../'
4
4
5
5
test ( 'renders div into document' , ( ) => {
6
6
const ref = React . createRef ( )
@@ -52,28 +52,7 @@ test('returns baseElement which defaults to document.body', () => {
52
52
expect ( baseElement ) . toBe ( document . body )
53
53
} )
54
54
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' , ( ) => {
77
56
class Test extends React . Component {
78
57
render ( ) {
79
58
return (
@@ -86,8 +65,6 @@ it('supports fragments', () => {
86
65
87
66
const { asFragment} = render ( < Test /> )
88
67
expect ( asFragment ( ) ) . toMatchSnapshot ( )
89
- cleanup ( )
90
- expect ( document . body . innerHTML ) . toBe ( '' )
91
68
} )
92
69
93
70
test ( 'renders options.wrapper around node' , ( ) => {
0 commit comments