Permalink
Browse files

closes #13034 Fixes the ScrollViewMock methods

Summary:
Solves #13034

Now the `ScrollView` mock has all the methods available.

React Native tests pass.

To test this specific part of the code,

```sh
$ react-native init Test
$ cd Test/
$ yarn add react-navigation
```

Then, add a simple project that uses `react-navigation`:

```js
import React from 'react';
import { Text } from 'react-native';
import { StackNavigator } from 'react-navigation';

class HomeScreen extends React.Component {
  static navigationOptions = {
    title: 'Welcome',
  };
  render() {
    return <Text>Hello, Navigation!</Text>;
  }
}

const SimpleApp = StackNavigator({
  Home: { screen: HomeScreen },
});

export default SimpleApp
```

Run the default render tests:

```js
$ npm run test
```
Closes #13048

Differential Revision: D4746028

Pulled By: shergin

fbshipit-source-id: cb1791978d15be7f5d14b7b22979388066ad6caa
  • Loading branch information...
alvaromb authored and facebook-github-bot committed Nov 28, 2017
1 parent 72e762d commit 0c8a3e4f797563c99e988ec2f42ec2a618a8b196
Showing with 8 additions and 1 deletion.
  1. +8 −1 Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js
@@ -8,16 +8,23 @@
*
* @flow
*/
/* eslint-env jest */
'use strict';
declare var jest: any;
const React = require('React');
const View = require('View');
const requireNativeComponent = require('requireNativeComponent');
const RCTScrollView = requireNativeComponent('RCTScrollView');
class ScrollViewMock extends React.Component<$FlowFixMeProps> {
const ScrollViewComponent = jest.genMockFromModule('ScrollView');
class ScrollViewMock extends ScrollViewComponent {
render() {
return (
<RCTScrollView {...this.props}>

0 comments on commit 0c8a3e4

Please sign in to comment.