@@ -98,14 +98,18 @@ describe('rc-queue-anim', () => {
98
98
} ) ;
99
99
100
100
it ( 'should render children' , ( ) => {
101
- const instance = createQueueAnimInstance ( ) ;
101
+ const instance = createQueueAnimInstance ( {
102
+ ease : 'easeInBounce' ,
103
+ } ) ;
102
104
const children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
103
105
expect ( children . length ) . to . be ( 4 ) ;
104
106
} ) ;
105
107
106
108
it ( 'should have queue animation' , ( done ) => {
107
109
const interval = defaultInterval ;
108
- const instance = createQueueAnimInstance ( ) ;
110
+ const instance = createQueueAnimInstance ( {
111
+ ease : 'easeInOutBounce' ,
112
+ } ) ;
109
113
shouldAnimatingThisOne ( instance , 0 ) ;
110
114
setTimeout ( ( ) => {
111
115
shouldAnimatingThisOne ( instance , 1 ) ;
@@ -121,7 +125,10 @@ describe('rc-queue-anim', () => {
121
125
122
126
it ( 'should have interval' , ( done ) => {
123
127
const interval = 300 ;
124
- const instance = createQueueAnimInstance ( { interval } ) ;
128
+ const instance = createQueueAnimInstance ( {
129
+ interval,
130
+ ease : 'easeOutBounce' ,
131
+ } ) ;
125
132
shouldAnimatingThisOne ( instance , 0 ) ;
126
133
setTimeout ( ( ) => {
127
134
shouldAnimatingThisOne ( instance , 1 ) ;
@@ -193,15 +200,13 @@ describe('rc-queue-anim', () => {
193
200
left : [ 100 , 0 ] ,
194
201
} ,
195
202
} ) ;
203
+ let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
204
+ expect ( isNaN ( getLeft ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
196
205
setTimeout ( ( ) => {
197
- let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
198
- expect ( isNaN ( getLeft ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
199
- setTimeout ( ( ) => {
200
- children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
201
- expect ( getLeft ( children [ 1 ] ) ) . to . above ( 0 ) ;
202
- done ( ) ;
203
- } , 10 ) ;
204
- } , 0 ) ;
206
+ children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
207
+ expect ( getLeft ( children [ 1 ] ) ) . to . above ( 0 ) ;
208
+ done ( ) ;
209
+ } , 10 ) ;
205
210
} ) ;
206
211
207
212
it ( 'should support animation when change direction at animating' , ( done ) => {
@@ -262,36 +267,34 @@ describe('rc-queue-anim', () => {
262
267
return { left : [ 100 , 0 ] } ;
263
268
} ,
264
269
} ) ;
270
+ let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
271
+ expect ( isNaN ( getLeft ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
272
+ expect ( isNaN ( getTop ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
265
273
setTimeout ( ( ) => {
266
- let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
267
- expect ( isNaN ( getLeft ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
268
- expect ( isNaN ( getTop ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
274
+ children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
275
+ expect ( getLeft ( children [ 1 ] ) ) . to . above ( 0 ) ;
276
+ expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
277
+ console . log ( 'left:' , getLeft ( children [ 1 ] ) ) ;
269
278
setTimeout ( ( ) => {
270
279
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
271
- expect ( getLeft ( children [ 1 ] ) ) . to . above ( 0 ) ;
272
- expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
273
- console . log ( 'left :' , getLeft ( children [ 1 ] ) ) ;
280
+ expect ( getTop ( children [ 2 ] ) ) . to . above ( 0 ) ;
281
+ expect ( isNaN ( getLeft ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
282
+ console . log ( 'top :' , getTop ( children [ 2 ] ) ) ;
274
283
setTimeout ( ( ) => {
275
284
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
276
- expect ( getTop ( children [ 2 ] ) ) . to . above ( 0 ) ;
285
+ expect ( getTop ( children [ 2 ] ) ) . to . be ( 100 ) ;
277
286
expect ( isNaN ( getLeft ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
278
- console . log ( 'top:' , getTop ( children [ 2 ] ) ) ;
279
- setTimeout ( ( ) => {
280
- children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
281
- expect ( getTop ( children [ 2 ] ) ) . to . be ( 100 ) ;
282
- expect ( isNaN ( getLeft ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
283
- console . log ( 'top_end:' , getTop ( children [ 2 ] ) ) ;
284
- done ( ) ;
285
- } , 500 ) ;
286
- } , interval ) ;
287
- setTimeout ( ( ) => {
288
- children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
289
- expect ( getLeft ( children [ 1 ] ) ) . to . be ( 100 ) ;
290
- expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
291
- console . log ( 'left_end:' , getLeft ( children [ 1 ] ) ) ;
287
+ console . log ( 'top_end:' , getTop ( children [ 2 ] ) ) ;
288
+ done ( ) ;
292
289
} , 500 ) ;
293
- } , 10 ) ;
294
- } , 0 ) ;
290
+ } , interval ) ;
291
+ setTimeout ( ( ) => {
292
+ children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
293
+ expect ( getLeft ( children [ 1 ] ) ) . to . be ( 100 ) ;
294
+ expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
295
+ console . log ( 'left_end:' , getLeft ( children [ 1 ] ) ) ;
296
+ } , 500 ) ;
297
+ } , 10 ) ;
295
298
} ) ;
296
299
297
300
it ( 'should has animating config is func leave' , ( done ) => {
0 commit comments