2016-12-20 23:44:54 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-12-20 23:44:54 +00:00
|
|
|
*
|
2018-05-11 02:06:46 +00:00
|
|
|
* @format
|
2016-12-20 23:44:54 +00:00
|
|
|
* @flow
|
|
|
|
*/
|
2017-11-28 20:24:51 +00:00
|
|
|
|
|
|
|
/* eslint-env jest */
|
|
|
|
|
2016-12-20 23:44:54 +00:00
|
|
|
'use strict';
|
|
|
|
|
2017-11-28 20:24:51 +00:00
|
|
|
declare var jest: any;
|
|
|
|
|
2016-12-20 23:44:54 +00:00
|
|
|
const React = require('React');
|
|
|
|
const View = require('View');
|
|
|
|
|
|
|
|
const requireNativeComponent = require('requireNativeComponent');
|
|
|
|
|
|
|
|
const RCTScrollView = requireNativeComponent('RCTScrollView');
|
|
|
|
|
2017-11-28 20:24:51 +00:00
|
|
|
const ScrollViewComponent = jest.genMockFromModule('ScrollView');
|
|
|
|
|
|
|
|
class ScrollViewMock extends ScrollViewComponent {
|
2016-12-20 23:44:54 +00:00
|
|
|
render() {
|
|
|
|
return (
|
2017-01-12 18:44:00 +00:00
|
|
|
<RCTScrollView {...this.props}>
|
2016-12-20 23:44:54 +00:00
|
|
|
{this.props.refreshControl}
|
2018-05-11 02:06:46 +00:00
|
|
|
<View>{this.props.children}</View>
|
2016-12-20 23:44:54 +00:00
|
|
|
</RCTScrollView>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = ScrollViewMock;
|