Skip to content

Commit 0fb0d58

Browse files
committed
add config is array to test
1 parent db825d8 commit 0fb0d58

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,24 @@ describe('rc-queue-anim', () => {
223223
}, 18);
224224
});
225225

226+
it('should support custom animation config array', (done) => {
227+
const instance = createQueueAnimInstance({
228+
animConfig: [
229+
[{ left: [100, 0] }, { top: [100, 0] }],
230+
],
231+
});
232+
let children = TestUtils.scryRenderedDOMComponentsWithTag(instance, 'div');
233+
expect(isNaN(children[1])).to.be.ok();
234+
ticker.timeout(() => {
235+
children = TestUtils.scryRenderedDOMComponentsWithTag(instance, 'div');
236+
console.log('left:', getLeft(children[1]));
237+
console.log('top:', getTop(children[1]));
238+
expect(getLeft(children[1])).to.be(100);
239+
expect(getTop(children[1])).to.be(100);
240+
done();
241+
}, 917);
242+
});
243+
226244
it('should support animation when change direction at animating', (done) => {
227245
const instance = createQueueAnimInstance({
228246
leaveReverse: true,

0 commit comments

Comments
 (0)