@@ -7,31 +7,29 @@ jest.useFakeTimers();
7
7
const MyComponent = ( ) => < div > foo</ div > ;
8
8
9
9
it ( 'should render correctly when in prop is false' , ( ) => {
10
- render ( < PageTransition node = { < MyComponent /> } / >) ;
10
+ render ( < PageTransition > < MyComponent /> </ PageTransition > ) ;
11
11
12
12
const element = screen . getByText ( 'foo' ) . parentNode ;
13
13
14
14
expect ( element ) . toHaveClass ( 'fade' ) ;
15
15
expect ( element ) . not . toHaveClass ( 'exitDone' ) ;
16
- expect ( element ) . toHaveStyle ( { zIndex : '0' } ) ;
17
16
} ) ;
18
17
19
18
it ( 'should render correctly when in prop is true' , ( ) => {
20
- render ( < PageTransition node = { < MyComponent /> } in / >) ;
19
+ render ( < PageTransition in > < MyComponent /> </ PageTransition > ) ;
21
20
22
21
const element = screen . getByText ( 'foo' ) . parentNode ;
23
22
24
23
expect ( element ) . toHaveClass ( 'fade' ) ;
25
24
expect ( element ) . not . toHaveClass ( 'enterDone' ) ;
26
- expect ( element ) . toHaveStyle ( { zIndex : '1' } ) ;
27
25
} ) ;
28
26
29
27
it ( 'should animate in, calling onEntered correctly' , ( ) => {
30
28
const handleEntered = jest . fn ( ) ;
31
29
32
- const { rerender } = render ( < PageTransition node = { < MyComponent /> } / >) ;
30
+ const { rerender } = render ( < PageTransition > < MyComponent /> </ PageTransition > ) ;
33
31
34
- rerender ( < PageTransition node = { < MyComponent /> } in onEntered = { handleEntered } / >) ;
32
+ rerender ( < PageTransition in onEntered = { handleEntered } > < MyComponent /> </ PageTransition > ) ;
35
33
36
34
const element = screen . getByText ( 'foo' ) . parentNode ;
37
35
@@ -51,9 +49,9 @@ it('should animate in, calling onEntered correctly', () => {
51
49
it ( 'should animate out, calling onEntered correctly' , ( ) => {
52
50
const handleExited = jest . fn ( ) ;
53
51
54
- const { rerender } = render ( < PageTransition node = { < MyComponent /> } in / >) ;
52
+ const { rerender } = render ( < PageTransition in > < MyComponent /> </ PageTransition > ) ;
55
53
56
- rerender ( < PageTransition node = { < MyComponent /> } onExited = { handleExited } / >) ;
54
+ rerender ( < PageTransition onExited = { handleExited } > < MyComponent /> </ PageTransition > ) ;
57
55
58
56
const element = screen . getByText ( 'foo' ) . parentNode ;
59
57
@@ -71,7 +69,7 @@ it('should animate out, calling onEntered correctly', () => {
71
69
} ) ;
72
70
73
71
it ( 'should respect passed className' , ( ) => {
74
- const { container } = render ( < PageTransition node = { < MyComponent /> } className = "foo" / >) ;
72
+ const { container } = render ( < PageTransition className = "foo" > < MyComponent /> </ PageTransition > ) ;
75
73
76
74
expect ( container . querySelector ( '.foo' ) ) . toBeInTheDocument ( ) ;
77
75
} ) ;
0 commit comments