Fix UIExplorer integration tests

Reviewed By: @vjeux

Differential Revision: D2510761

fb-gh-sync-id: 21ec8988305ba9f3526277a8b445676ac4fcf3aa
This commit is contained in:
Pieter De Baets 2015-10-06 07:34:44 -07:00 committed by facebook-github-bot-4
parent ea8d0b6c1f
commit 81278d1a39
3 changed files with 11 additions and 8 deletions

View File

@ -58,12 +58,13 @@
expectErrorRegex:@"because shouldThrow"];
}
RCT_TEST(TimersTest)
// This list should be kept in sync with IntegrationTestsApp.js
RCT_TEST(IntegrationTestHarnessTest)
RCT_TEST(TimersTest)
RCT_TEST(AsyncStorageTest)
// RCT_TEST(LayoutEventsTest) -- Disabled: #8153468
RCT_TEST(LayoutEventsTest)
RCT_TEST(AppEventsTest)
RCT_TEST(SimpleSnapshotTest)
RCT_TEST(PromiseTest)
// RCT_TEST(SimpleSnapshotTest) -- Disabled: #8153475
@end

View File

@ -23,6 +23,7 @@ var {
View,
} = React;
/* Keep this list in sync with UIExplorerIntegrationTests.m */
var TESTS = [
require('./IntegrationTestHarnessTest'),
require('./TimersTest'),

View File

@ -25,7 +25,7 @@ var TestModule = NativeModules.TestModule;
var deepDiffer = require('deepDiffer');
function debug() {
//console.log.apply(null, arguments);
// console.log.apply(null, arguments);
}
type LayoutEvent = {
@ -46,22 +46,25 @@ var LayoutEventsTest = React.createClass({
};
},
animateViewLayout: function() {
debug('animateViewLayout invoked');
LayoutAnimation.configureNext(
LayoutAnimation.Presets.spring,
() => {
debug('layout animation done.');
debug('animateViewLayout done');
this.checkLayout(this.addWrapText);
}
);
this.setState({viewStyle: {margin: 60}});
},
addWrapText: function() {
debug('addWrapText invoked');
this.setState(
{extraText: ' And a bunch more text to wrap around a few lines.'},
() => this.checkLayout(this.changeContainer)
);
},
changeContainer: function() {
debug('changeContainer invoked');
this.setState(
{containerStyle: {width: 280}},
() => this.checkLayout(TestModule.markTestCompleted)
@ -113,6 +116,7 @@ var LayoutEventsTest = React.createClass({
var viewStyle = [styles.view, this.state.viewStyle];
var textLayout = this.state.textLayout || {width: '?', height: '?'};
var imageLayout = this.state.imageLayout || {x: '?', y: '?'};
debug('viewLayout', this.state.viewLayout);
return (
<View style={[styles.container, this.state.containerStyle]}>
<View ref="view" onLayout={this.onViewLayout} style={viewStyle}>
@ -122,9 +126,6 @@ var LayoutEventsTest = React.createClass({
style={styles.image}
source={{uri: 'uie_thumb_big.png'}}
/>
<Text>
ViewLayout: {JSON.stringify(this.state.viewLayout, null, ' ') + '\n\n'}
</Text>
<Text ref="txt" onLayout={this.onTextLayout} style={styles.text}>
A simple piece of text.{this.state.extraText}
</Text>