@@ -37,15 +37,15 @@ describe('rc-queue-anim', () => {
37
37
function shouldAnimatingThisOne ( instance , index ) {
38
38
const children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
39
39
children . forEach ( ( node , i ) => {
40
- console . log ( i , getOpacity ( node ) ) ;
40
+ console . log ( index , i , getOpacity ( node ) ) ;
41
41
if ( i === 0 ) {
42
42
return ;
43
43
}
44
44
if ( i <= index ) {
45
45
expect ( getOpacity ( node ) ) . to . above ( 0 ) ;
46
46
} else {
47
47
// placeholder
48
- expect ( node . innerHTML ) . to . be ( '' ) ;
48
+ // expect(node.innerHTML).to.be('');
49
49
}
50
50
} ) ;
51
51
}
@@ -94,10 +94,10 @@ describe('rc-queue-anim', () => {
94
94
< QueueAnim { ...props } >
95
95
{ this . state . show
96
96
? this . state . items . map ( item => (
97
- < div key = { item . key } style = { { position : 'relative' } } >
98
- { item . content }
99
- </ div >
100
- ) )
97
+ < div key = { item . key } style = { { position : 'relative' } } >
98
+ { item . content }
99
+ </ div >
100
+ ) )
101
101
: null }
102
102
{ null }
103
103
</ QueueAnim >
@@ -134,21 +134,21 @@ describe('rc-queue-anim', () => {
134
134
const children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
135
135
expect ( children . length ) . to . be ( 4 ) ;
136
136
} ) ;
137
-
138
137
it ( 'should have queue animation' , done => {
139
138
const interval = defaultInterval ;
140
139
const instance = createQueueAnimInstance ( ) ;
141
140
shouldAnimatingThisOne ( instance , 0 ) ;
142
- ticker . timeout ( ( ) => {
141
+ setTimeout ( ( ) => {
142
+ console . log ( 4443 )
143
143
shouldAnimatingThisOne ( instance , 1 ) ;
144
- ticker . timeout ( ( ) => {
144
+ setTimeout ( ( ) => {
145
145
shouldAnimatingThisOne ( instance , 2 ) ;
146
- ticker . timeout ( ( ) => {
146
+ setTimeout ( ( ) => {
147
147
shouldAnimatingThisOne ( instance , 3 ) ;
148
148
done ( ) ;
149
149
} , interval ) ;
150
150
} , interval ) ;
151
- } , 55 ) ; // tweenone 更新规则,去除 ticker 的 0 帧,改用直接运行,从原来的 18ms 调整为 55ms;
151
+ } , 55 ) ;
152
152
} ) ;
153
153
154
154
it ( 'should have interval' , done => {
@@ -157,11 +157,11 @@ describe('rc-queue-anim', () => {
157
157
interval,
158
158
} ) ;
159
159
shouldAnimatingThisOne ( instance , 0 ) ;
160
- ticker . timeout ( ( ) => {
160
+ setTimeout ( ( ) => {
161
161
shouldAnimatingThisOne ( instance , 1 ) ;
162
- ticker . timeout ( ( ) => {
162
+ setTimeout ( ( ) => {
163
163
shouldAnimatingThisOne ( instance , 2 ) ;
164
- ticker . timeout ( ( ) => {
164
+ setTimeout ( ( ) => {
165
165
shouldAnimatingThisOne ( instance , 3 ) ;
166
166
done ( ) ;
167
167
} , interval ) ;
@@ -174,13 +174,13 @@ describe('rc-queue-anim', () => {
174
174
const delay = 1000 ;
175
175
const instance = createQueueAnimInstance ( { delay } ) ;
176
176
shouldAnimatingThisOne ( instance , 0 ) ;
177
- ticker . timeout ( ( ) => {
177
+ setTimeout ( ( ) => {
178
178
shouldAnimatingThisOne ( instance , 0 ) ;
179
- ticker . timeout ( ( ) => {
179
+ setTimeout ( ( ) => {
180
180
shouldAnimatingThisOne ( instance , 1 ) ;
181
- ticker . timeout ( ( ) => {
181
+ setTimeout ( ( ) => {
182
182
shouldAnimatingThisOne ( instance , 2 ) ;
183
- ticker . timeout ( ( ) => {
183
+ setTimeout ( ( ) => {
184
184
shouldAnimatingThisOne ( instance , 3 ) ;
185
185
done ( ) ;
186
186
} , interval ) ;
@@ -195,10 +195,10 @@ describe('rc-queue-anim', () => {
195
195
duration,
196
196
} ) ;
197
197
let children ;
198
- ticker . timeout ( ( ) => {
198
+ setTimeout ( ( ) => {
199
199
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
200
200
expect ( getOpacity ( children [ 1 ] ) ) . to . be . above ( 0 ) ;
201
- ticker . timeout ( ( ) => {
201
+ setTimeout ( ( ) => {
202
202
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
203
203
expect ( getOpacity ( children [ 1 ] ) ) . to . above ( 0.99 ) ;
204
204
done ( ) ;
@@ -209,14 +209,14 @@ describe('rc-queue-anim', () => {
209
209
it ( 'should have leave animation' , done => {
210
210
const interval = defaultInterval ;
211
211
const instance = createQueueAnimInstance ( ) ;
212
- ticker . timeout ( ( ) => {
212
+ setTimeout ( ( ) => {
213
213
const children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
214
214
expect ( getOpacity ( children [ 3 ] ) ) . to . be ( 1 ) ;
215
215
const removeIndex = instance . removeOne ( ) ;
216
- ticker . timeout ( ( ) => {
216
+ setTimeout ( ( ) => {
217
217
expect ( getOpacity ( children [ removeIndex + 1 ] ) ) . to . below ( 1 ) ;
218
218
expect ( children . length ) . to . be ( 4 ) ;
219
- ticker . timeout ( ( ) => {
219
+ setTimeout ( ( ) => {
220
220
expect ( TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) . length ) . to . be ( 3 ) ;
221
221
done ( ) ;
222
222
} , 500 ) ;
@@ -232,7 +232,7 @@ describe('rc-queue-anim', () => {
232
232
} ) ;
233
233
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
234
234
expect ( isNaN ( children [ 1 ] ) ) . to . be . ok ( ) ;
235
- ticker . timeout ( ( ) => {
235
+ setTimeout ( ( ) => {
236
236
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
237
237
expect ( getLeft ( children [ 1 ] ) ) . to . above ( 0 ) ;
238
238
done ( ) ;
@@ -245,7 +245,7 @@ describe('rc-queue-anim', () => {
245
245
} ) ;
246
246
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
247
247
expect ( isNaN ( children [ 1 ] ) ) . to . be . ok ( ) ;
248
- ticker . timeout ( ( ) => {
248
+ setTimeout ( ( ) => {
249
249
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
250
250
console . log ( 'left:' , getLeft ( children [ 1 ] ) ) ;
251
251
console . log ( 'top:' , getTop ( children [ 1 ] ) ) ;
@@ -263,7 +263,7 @@ describe('rc-queue-anim', () => {
263
263
let maxOpacity ;
264
264
const opacityArray = [ ] ;
265
265
//
266
- ticker . timeout ( ( ) => {
266
+ setTimeout ( ( ) => {
267
267
const interval = ticker . interval ( ( ) => {
268
268
index += 1 ;
269
269
// 取第一个, 时间为 450 加间隔 100 ,,应该 550 为最高点。10不是最高点
@@ -304,17 +304,17 @@ describe('rc-queue-anim', () => {
304
304
const instance = createQueueAnimInstance ( {
305
305
ease : 'easeInElastic' ,
306
306
} ) ;
307
- ticker . timeout ( ( ) => {
307
+ setTimeout ( ( ) => {
308
308
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
309
309
expect ( children [ 1 ] . className ) . to . contain ( 'queue-anim-entering' ) ;
310
- ticker . timeout ( ( ) => {
310
+ setTimeout ( ( ) => {
311
311
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
312
312
expect ( children [ 1 ] . className ) . not . to . contain ( 'queue-anim-entering' ) ;
313
313
const removeIndex = instance . removeOne ( ) ;
314
- ticker . timeout ( ( ) => {
314
+ setTimeout ( ( ) => {
315
315
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
316
316
expect ( children [ removeIndex + 1 ] . className ) . to . contain ( 'queue-anim-leaving' ) ;
317
- ticker . timeout ( ( ) => {
317
+ setTimeout ( ( ) => {
318
318
expect ( children [ removeIndex + 1 ] . className ) . not . to . contain ( 'queue-anim-leaving' ) ;
319
319
done ( ) ;
320
320
} , 550 ) ;
@@ -336,25 +336,25 @@ describe('rc-queue-anim', () => {
336
336
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
337
337
// expect(isNaN(getLeft(children[1]))).to.be.ok();
338
338
// expect(isNaN(getTop(children[2]))).to.be.ok();
339
- ticker . timeout ( ( ) => {
339
+ setTimeout ( ( ) => {
340
340
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
341
341
expect ( getLeft ( children [ 1 ] ) ) . to . above ( 0 ) ;
342
342
expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
343
343
console . log ( 'left:' , getLeft ( children [ 1 ] ) ) ;
344
- ticker . timeout ( ( ) => {
344
+ setTimeout ( ( ) => {
345
345
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
346
346
expect ( getTop ( children [ 2 ] ) ) . to . above ( 0 ) ;
347
347
expect ( isNaN ( getLeft ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
348
348
console . log ( 'top:' , getTop ( children [ 2 ] ) ) ;
349
- ticker . timeout ( ( ) => {
349
+ setTimeout ( ( ) => {
350
350
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
351
351
expect ( getTop ( children [ 2 ] ) ) . to . above ( 99.99 ) ;
352
352
expect ( isNaN ( getLeft ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
353
353
console . log ( 'top_end:' , getTop ( children [ 2 ] ) ) ;
354
354
done ( ) ;
355
355
} , 550 ) ; // +18 帧为 tween-one 补帧。。。。complete 在时间结束后下一帧跟上。
356
356
} , interval ) ;
357
- ticker . timeout ( ( ) => {
357
+ setTimeout ( ( ) => {
358
358
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
359
359
expect ( getLeft ( children [ 1 ] ) ) . to . above ( 99.99 ) ;
360
360
expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
@@ -373,26 +373,26 @@ describe('rc-queue-anim', () => {
373
373
} ,
374
374
} ) ;
375
375
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
376
- ticker . timeout ( ( ) => {
376
+ setTimeout ( ( ) => {
377
377
instance . toggle ( ) ;
378
378
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
379
379
console . log ( 'left:' , getLeft ( children [ 1 ] ) ) ;
380
380
console . log ( 'top:' , getTop ( children [ 2 ] ) ) ;
381
381
expect ( getLeft ( children [ 1 ] ) ) . to . be ( 100 ) ;
382
382
expect ( getTop ( children [ 2 ] ) ) . to . be ( 100 ) ;
383
383
expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
384
- ticker . timeout ( ( ) => {
384
+ setTimeout ( ( ) => {
385
385
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
386
386
expect ( getLeft ( children [ 1 ] ) ) . to . be ( 0 ) ;
387
387
expect ( isNaN ( getTop ( children [ 1 ] ) ) ) . to . be . ok ( ) ;
388
388
console . log ( 'left_end:' , getLeft ( children [ 1 ] ) ) ;
389
389
} , 500 ) ;
390
- ticker . timeout ( ( ) => {
390
+ setTimeout ( ( ) => {
391
391
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
392
392
expect ( getTop ( children [ 2 ] ) ) . to . below ( 100 ) ;
393
393
expect ( isNaN ( getLeft ( children [ 2 ] ) ) ) . to . be . ok ( ) ;
394
394
console . log ( 'top:' , getTop ( children [ 2 ] ) ) ;
395
- ticker . timeout ( ( ) => {
395
+ setTimeout ( ( ) => {
396
396
children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
397
397
console . log ( 'top_end:' , getTop ( children [ 2 ] ) ) ;
398
398
expect ( getTop ( children [ 2 ] ) ) . to . be ( 0 ) ;
0 commit comments