@@ -19,7 +19,8 @@ describe('rc-queue-anim', function () {
19
19
return parseFloat ( node . style . left ) ;
20
20
}
21
21
22
- function shouldAnimatingThisOne ( children , index ) {
22
+ function shouldAnimatingThisOne ( instance , index ) {
23
+ let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
23
24
children . forEach ( function ( node , i ) {
24
25
console . log ( i , node . style . visibility , getOpacity ( node ) ) ;
25
26
if ( i === 0 ) {
@@ -97,13 +98,13 @@ describe('rc-queue-anim', function () {
97
98
const interval = defaultInterval ;
98
99
instance = createQueueAnimInstance ( ) ;
99
100
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
100
- shouldAnimatingThisOne ( children , 0 ) ;
101
+ shouldAnimatingThisOne ( instance , 0 ) ;
101
102
setTimeout ( function ( ) {
102
- shouldAnimatingThisOne ( children , 1 ) ;
103
+ shouldAnimatingThisOne ( instance , 1 ) ;
103
104
setTimeout ( function ( ) {
104
- shouldAnimatingThisOne ( children , 2 ) ;
105
+ shouldAnimatingThisOne ( instance , 2 ) ;
105
106
setTimeout ( function ( ) {
106
- shouldAnimatingThisOne ( children , 3 ) ;
107
+ shouldAnimatingThisOne ( instance , 3 ) ;
107
108
done ( ) ;
108
109
} , interval ) ;
109
110
} , interval ) ;
@@ -113,14 +114,13 @@ describe('rc-queue-anim', function () {
113
114
it ( 'should have interval' , function ( done ) {
114
115
const interval = 300 ;
115
116
instance = createQueueAnimInstance ( { interval } ) ;
116
- let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
117
- shouldAnimatingThisOne ( children , 0 ) ;
117
+ shouldAnimatingThisOne ( instance , 0 ) ;
118
118
setTimeout ( function ( ) {
119
- shouldAnimatingThisOne ( children , 1 ) ;
119
+ shouldAnimatingThisOne ( instance , 1 ) ;
120
120
setTimeout ( function ( ) {
121
- shouldAnimatingThisOne ( children , 2 ) ;
121
+ shouldAnimatingThisOne ( instance , 2 ) ;
122
122
setTimeout ( function ( ) {
123
- shouldAnimatingThisOne ( children , 3 ) ;
123
+ shouldAnimatingThisOne ( instance , 3 ) ;
124
124
done ( ) ;
125
125
} , interval ) ;
126
126
} , interval ) ;
@@ -132,15 +132,15 @@ describe('rc-queue-anim', function () {
132
132
const delay = 1000 ;
133
133
instance = createQueueAnimInstance ( { delay } ) ;
134
134
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
135
- shouldAnimatingThisOne ( children , 0 ) ;
135
+ shouldAnimatingThisOne ( instance , 0 ) ;
136
136
setTimeout ( function ( ) {
137
- shouldAnimatingThisOne ( children , 0 ) ;
137
+ shouldAnimatingThisOne ( instance , 0 ) ;
138
138
setTimeout ( function ( ) {
139
- shouldAnimatingThisOne ( children , 1 ) ;
139
+ shouldAnimatingThisOne ( instance , 1 ) ;
140
140
setTimeout ( function ( ) {
141
- shouldAnimatingThisOne ( children , 2 ) ;
141
+ shouldAnimatingThisOne ( instance , 2 ) ;
142
142
setTimeout ( function ( ) {
143
- shouldAnimatingThisOne ( children , 3 ) ;
143
+ shouldAnimatingThisOne ( instance , 3 ) ;
144
144
done ( ) ;
145
145
} , interval ) ;
146
146
} , interval ) ;
@@ -153,7 +153,7 @@ describe('rc-queue-anim', function () {
153
153
const duration = 300 ;
154
154
instance = createQueueAnimInstance ( { duration } ) ;
155
155
let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
156
- shouldAnimatingThisOne ( children , 0 ) ;
156
+ shouldAnimatingThisOne ( instance , 0 ) ;
157
157
setTimeout ( function ( ) {
158
158
expect ( getOpacity ( children [ 1 ] ) ) . to . be . above ( 0 ) ;
159
159
setTimeout ( function ( ) {
@@ -166,8 +166,8 @@ describe('rc-queue-anim', function () {
166
166
it ( 'should have leave animation' , function ( done ) {
167
167
const interval = defaultInterval ;
168
168
instance = createQueueAnimInstance ( ) ;
169
- let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
170
169
setTimeout ( function ( ) {
170
+ let children = TestUtils . scryRenderedDOMComponentsWithTag ( instance , 'div' ) ;
171
171
expect ( getOpacity ( children [ 3 ] ) ) . to . be ( 1 ) ;
172
172
const removeIndex = instance . removeOne ( ) ;
173
173
setTimeout ( function ( ) {
0 commit comments