File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,22 @@ describe('Fade', () => {
24
24
fade . rerender ( < Fade is_in /> ) ;
25
25
jest . runAllTimers ( ) ;
26
26
27
- expect ( fade . container . querySelector ( 'div.fade.show' ) ) . not . toBe (
28
- null
29
- ) ;
27
+ expect ( fade . container . querySelector ( 'div.fade.show' ) ) . not . toBe ( null ) ;
28
+ } ) ;
29
+
30
+ test ( 'sets visibility hidden when is_in is false and not transitioning' , ( ) => {
31
+ const fade = render ( < Fade is_in = { false } timeout = { 1000 } /> ) ;
32
+
33
+ expect ( fade . container . firstChild ) . toHaveStyle ( 'visibility:hidden' ) ;
34
+
35
+ fade . rerender ( < Fade is_in timeout = { 1000 } /> ) ;
36
+ expect ( fade . container . firstChild ) . not . toHaveStyle ( 'visibility:hidden' ) ;
37
+ jest . runAllTimers ( ) ;
38
+ expect ( fade . container . firstChild ) . not . toHaveStyle ( 'visibility:hidden' ) ;
39
+
40
+ fade . rerender ( < Fade is_in = { false } timout = { 1000 } /> ) ;
41
+ expect ( fade . container . firstChild ) . not . toHaveStyle ( 'visibility:hidden' ) ;
42
+ jest . runAllTimers ( ) ;
43
+ expect ( fade . container . firstChild ) . toHaveStyle ( 'visibility:hidden' ) ;
30
44
} ) ;
31
45
} ) ;
You can’t perform that action at this time.
0 commit comments