File tree Expand file tree Collapse file tree 6 files changed +144
-2
lines changed
BatchedBridge/BatchedBridgedModules/__mocks__ Expand file tree Collapse file tree 6 files changed +144
-2
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright 2004-present Facebook. All Rights Reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ *
3
9
*/
4
10
'use strict' ;
5
11
@@ -27,7 +33,14 @@ var NativeModules = {
27
33
UIManager : {
28
34
customBubblingEventTypes : { } ,
29
35
customDirectEventTypes : { } ,
30
- Dimensions : { } ,
36
+ Dimensions : {
37
+ window : {
38
+ width : 750 ,
39
+ height : 1334 ,
40
+ scale : 2 ,
41
+ fontScale : 2 ,
42
+ }
43
+ } ,
31
44
RCTModalFullscreenView : {
32
45
Constants : { } ,
33
46
} ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ */
9
+
10
+ jest . disableAutomock ( ) ;
11
+
12
+ jest . mock ( 'NativeModules' )
13
+ . mock ( 'Text' )
14
+ . mock ( 'ensureComponentIsNative' )
15
+ . mock ( 'View' ) ;
16
+
17
+ const React = require ( 'React' ) ;
18
+ const ReactTestRenderer = require ( 'ReactTestRenderer' ) ;
19
+ const Text = require ( 'Text' ) ;
20
+ const TouchableHighlight = require ( 'TouchableHighlight' ) ;
21
+
22
+ describe ( 'TouchableHighlight' , ( ) => {
23
+ it ( 'renders correctly' , ( ) => {
24
+ const instance = ReactTestRenderer . create (
25
+ < TouchableHighlight style = { { } } >
26
+ < Text > Touchable</ Text >
27
+ </ TouchableHighlight >
28
+ ) ;
29
+
30
+ expect ( instance . toJSON ( ) ) . toMatchSnapshot ( ) ;
31
+ } ) ;
32
+ } ) ;
Original file line number Diff line number Diff line change
1
+ exports [` TouchableHighlight renders correctly 0` ] = `
2
+ <View
3
+ accessible = { true }
4
+ accessibilityLabel = { undefined }
5
+ accessibilityComponentType = { undefined }
6
+ accessibilityTraits = { undefined }
7
+ style = {
8
+ Array [
9
+ 4 ,
10
+ Object {}
11
+ ]
12
+ }
13
+ onLayout = { undefined }
14
+ hitSlop = { undefined }
15
+ onStartShouldSetResponder = { [Function bound touchableHandleStartShouldSetResponder ]}
16
+ onResponderTerminationRequest = { [Function bound touchableHandleResponderTerminationRequest ]}
17
+ onResponderGrant = { [Function bound touchableHandleResponderGrant ]}
18
+ onResponderMove = { [Function bound touchableHandleResponderMove ]}
19
+ onResponderRelease = { [Function bound touchableHandleResponderRelease ]}
20
+ onResponderTerminate = { [Function bound touchableHandleResponderTerminate ]}
21
+ testID = { undefined } >
22
+ <Text >
23
+ Touchable
24
+ </Text >
25
+ </View >
26
+ ` ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ *
9
+ */
10
+ 'use strict' ;
11
+
12
+ const React = require ( 'React' ) ;
13
+ const StyleSheetPropType = require ( 'StyleSheetPropType' ) ;
14
+ const ViewStylePropTypes = require ( 'ViewStylePropTypes' ) ;
15
+
16
+ class View extends React . Component {
17
+ render ( ) {
18
+ const { children, ...props } = this . props ;
19
+ return React . createElement ( 'View' , props , children ) ;
20
+ }
21
+ }
22
+
23
+ View . propTypes = {
24
+ style : StyleSheetPropType ( ViewStylePropTypes ) ,
25
+ } ;
26
+
27
+ module . exports = View ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ *
9
+ */
10
+ 'use strict' ;
11
+
12
+ const React = require ( 'React' ) ;
13
+ const { Component} = React ;
14
+
15
+ class Image extends Component {
16
+ render ( ) {
17
+ const { children, ...props } = this . props ;
18
+ return React . createElement ( 'Image' , props , children ) ;
19
+ }
20
+ }
21
+
22
+ module . exports = Image ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
+ *
9
+ */
10
+ 'use strict' ;
11
+
12
+ const React = require ( 'React' ) ;
13
+ const { Component} = React ;
14
+
15
+ class Text extends Component {
16
+ render ( ) {
17
+ const { children, ...props } = this . props ;
18
+ return React . createElement ( 'Text' , props , children ) ;
19
+ }
20
+ }
21
+
22
+ module . exports = Text ;
You can’t perform that action at this time.
0 commit comments