File tree 1 file changed +25
-0
lines changed 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -62,5 +62,30 @@ describe('Progress', () => {
62
62
expect ( circlePathsLength ) . to . be ( 0 ) ;
63
63
circle . forceUpdate ( ) ; // See: https://github.com/react-component/progress/issues/35
64
64
} ) ;
65
+
66
+ it ( 'change with animation' , ( ) => {
67
+ class Demo extends React . Component {
68
+ state = {
69
+ percent : '0' ,
70
+ }
71
+ render ( ) {
72
+ return (
73
+ < div >
74
+ < Circle percent = { this . state . percent } strokeWidth = "1" />
75
+ </ div >
76
+ ) ;
77
+ }
78
+ }
79
+ const circle = ReactDOM . render ( < Demo /> , div ) ;
80
+ const circlePathsLength = document . getElementsByClassName ( 'rc-progress-circle-path' ) . length ;
81
+ expect ( circlePathsLength ) . to . be ( 0 ) ;
82
+ expect ( circle . state . percent ) . to . be ( '0' ) ;
83
+ circle . setState ( {
84
+ percent : '30' ,
85
+ } ) ;
86
+ const _circlePathsLength = document . getElementsByClassName ( 'rc-progress-circle-path' ) . length ;
87
+ expect ( _circlePathsLength ) . to . greaterThan ( 0 ) ;
88
+ expect ( circle . state . percent ) . to . be ( '30' ) ;
89
+ } ) ;
65
90
} ) ;
66
91
} ) ;
You can’t perform that action at this time.
0 commit comments