mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Prettier IntegrationTests
Reviewed By: sahrens Differential Revision: D7958195 fbshipit-source-id: 253c0eec593228e7b6bc66606584877161c6bfc2
This commit is contained in:
committed by
Facebook Github Bot
parent
86b6f5d39e
commit
dca21c8f23
@@ -3,7 +3,10 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
@@ -11,9 +14,9 @@ var createReactClass = require('create-react-class');
|
||||
var ReactNative = require('react-native');
|
||||
var RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
|
||||
var Subscribable = require('Subscribable');
|
||||
var { View } = ReactNative;
|
||||
var {View} = ReactNative;
|
||||
|
||||
var { TestModule } = ReactNative.NativeModules;
|
||||
var {TestModule} = ReactNative.NativeModules;
|
||||
|
||||
var reactViewWidth = 111;
|
||||
var reactViewHeight = 222;
|
||||
@@ -28,7 +31,7 @@ var SizeFlexibilityUpdateTest = createReactClass({
|
||||
this.addListenerOn(
|
||||
RCTNativeAppEventEmitter,
|
||||
'rootViewDidChangeIntrinsicSize',
|
||||
this.rootViewDidChangeIntrinsicSize
|
||||
this.rootViewDidChangeIntrinsicSize,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -38,7 +41,6 @@ var SizeFlexibilityUpdateTest = createReactClass({
|
||||
},
|
||||
|
||||
rootViewDidChangeIntrinsicSize: function(intrinsicSize) {
|
||||
|
||||
if (finalState) {
|
||||
// If a test reaches its final state, it is not expected to do anything more
|
||||
TestModule.markTestPassed(false);
|
||||
@@ -46,25 +48,37 @@ var SizeFlexibilityUpdateTest = createReactClass({
|
||||
}
|
||||
|
||||
if (this.props.both) {
|
||||
if (intrinsicSize.width === reactViewWidth && intrinsicSize.height === reactViewHeight) {
|
||||
if (
|
||||
intrinsicSize.width === reactViewWidth &&
|
||||
intrinsicSize.height === reactViewHeight
|
||||
) {
|
||||
this.markPassed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.props.height) {
|
||||
if (intrinsicSize.width !== reactViewWidth && intrinsicSize.height === reactViewHeight) {
|
||||
if (
|
||||
intrinsicSize.width !== reactViewWidth &&
|
||||
intrinsicSize.height === reactViewHeight
|
||||
) {
|
||||
this.markPassed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.props.width) {
|
||||
if (intrinsicSize.width === reactViewWidth && intrinsicSize.height !== reactViewHeight) {
|
||||
if (
|
||||
intrinsicSize.width === reactViewWidth &&
|
||||
intrinsicSize.height !== reactViewHeight
|
||||
) {
|
||||
this.markPassed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.props.none) {
|
||||
if (intrinsicSize.width !== reactViewWidth && intrinsicSize.height !== reactViewHeight) {
|
||||
if (
|
||||
intrinsicSize.width !== reactViewWidth &&
|
||||
intrinsicSize.height !== reactViewHeight
|
||||
) {
|
||||
this.markPassed();
|
||||
return;
|
||||
}
|
||||
@@ -72,10 +86,8 @@ var SizeFlexibilityUpdateTest = createReactClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={{'height':reactViewHeight, 'width':reactViewWidth}}/>
|
||||
);
|
||||
}
|
||||
return <View style={{height: reactViewHeight, width: reactViewWidth}} />;
|
||||
},
|
||||
});
|
||||
|
||||
SizeFlexibilityUpdateTest.displayName = 'SizeFlexibilityUpdateTest';
|
||||
|
||||
Reference in New Issue
Block a user