mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-08 18:23:13 +08:00
Allow Animated.parallel to accept empty element in the array
This commit is contained in:
@@ -205,6 +205,16 @@ describe('Animated Parallel', () => {
|
||||
expect(cb).toBeCalledWith({finished: true});
|
||||
});
|
||||
|
||||
it('works with an empty element in array', () => {
|
||||
var anim1 = {start: jest.genMockFunction()};
|
||||
var cb = jest.genMockFunction();
|
||||
Animated.parallel([null, anim1]).start(cb);
|
||||
|
||||
expect(anim1.start).toBeCalled();
|
||||
anim1.start.mock.calls[0][0]({finished: true});
|
||||
|
||||
expect(cb).toBeCalledWith({finished: true});
|
||||
});
|
||||
|
||||
it('parellelizes well', () => {
|
||||
var anim1 = {start: jest.genMockFunction()};
|
||||
|
||||
Reference in New Issue
Block a user