2015-05-02 17:09:36 +00:00
|
|
|
/**
|
2017-05-06 03:50:47 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
2015-05-02 17:09:36 +00:00
|
|
|
*
|
2017-05-06 03:50:47 +00:00
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
2015-05-02 17:09:36 +00:00
|
|
|
*
|
|
|
|
* @providesModule TextUpdateTest
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
2016-04-09 03:36:40 +00:00
|
|
|
var React = require('react');
|
2017-07-07 21:24:25 +00:00
|
|
|
var createReactClass = require('create-react-class');
|
2016-04-09 03:36:40 +00:00
|
|
|
var ReactNative = require('react-native');
|
2015-05-02 17:09:36 +00:00
|
|
|
var TimerMixin = require('react-timer-mixin');
|
|
|
|
var {
|
|
|
|
NativeModules,
|
|
|
|
StyleSheet,
|
|
|
|
Text,
|
2016-04-09 03:36:40 +00:00
|
|
|
} = ReactNative;
|
2015-05-02 17:09:36 +00:00
|
|
|
|
|
|
|
var TestManager = NativeModules.TestManager || NativeModules.SnapshotTestManager;
|
|
|
|
|
2017-07-07 21:24:25 +00:00
|
|
|
var TextUpdateTest = createReactClass({
|
|
|
|
displayName: 'TextUpdateTest',
|
2015-05-02 17:09:36 +00:00
|
|
|
mixins: [TimerMixin],
|
|
|
|
getInitialState: function() {
|
|
|
|
return {seeMore: true};
|
|
|
|
},
|
|
|
|
componentDidMount: function() {
|
|
|
|
this.requestAnimationFrame(
|
2016-11-04 12:40:26 +00:00
|
|
|
() => this.setState({seeMore: false}, () => {
|
|
|
|
TestManager.markTestCompleted();
|
|
|
|
})
|
2015-05-02 17:09:36 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
render: function() {
|
|
|
|
return (
|
|
|
|
<Text
|
|
|
|
style={styles.container}
|
|
|
|
onPress={() => this.setState({seeMore: !this.state.seeMore})}>
|
|
|
|
<Text>Tap to see more (bugs)...</Text>
|
2015-05-02 17:09:37 +00:00
|
|
|
{this.state.seeMore && 'raw text'}
|
2015-05-02 17:09:36 +00:00
|
|
|
</Text>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
margin: 10,
|
|
|
|
marginTop: 100,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = TextUpdateTest;
|