Skip to content

Commit 592cb71

Browse files
ignacioolafacebook-github-bot
authored andcommitted
Fix inline styles in IntegrationTests (facebook#22165)
Summary: Fix `react-native/no-inline-styles` eslint warning for IntegrationTests module. Pull Request resolved: facebook#22165 Differential Revision: D12946915 Pulled By: TheSavior fbshipit-source-id: 438bb74cc34dd5893f725e4865568715ce949c3a
1 parent a1316c3 commit 592cb71

4 files changed

+27
-6
lines changed

IntegrationTests/AsyncStorageTest.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
const React = require('react');
1414
const ReactNative = require('react-native');
15-
const {AsyncStorage, Text, View} = ReactNative;
15+
const {AsyncStorage, Text, View, StyleSheet} = ReactNative;
1616
const {TestModule} = ReactNative.NativeModules;
1717

1818
const deepDiffer = require('deepDiffer');
@@ -191,7 +191,7 @@ class AsyncStorageTest extends React.Component<{}, $FlowFixMeState> {
191191

192192
render() {
193193
return (
194-
<View style={{backgroundColor: 'white', padding: 40}}>
194+
<View style={styles.container}>
195195
<Text>
196196
{/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This
197197
* comment suppresses an error found when Flow v0.54 was deployed.
@@ -205,6 +205,13 @@ class AsyncStorageTest extends React.Component<{}, $FlowFixMeState> {
205205
}
206206
}
207207

208+
const styles = StyleSheet.create({
209+
container: {
210+
backgroundColor: 'white',
211+
padding: 40,
212+
},
213+
});
214+
208215
AsyncStorageTest.displayName = 'AsyncStorageTest';
209216

210217
module.exports = AsyncStorageTest;

IntegrationTests/ImageCachePolicyTest.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
5858

5959
render() {
6060
return (
61-
<View style={{flex: 1}}>
61+
<View style={styles.container}>
6262
<Text>Hello</Text>
6363
<Image
6464
source={{
@@ -110,6 +110,9 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
110110
}
111111

112112
const styles = StyleSheet.create({
113+
container: {
114+
flex: 1,
115+
},
113116
base: {
114117
width: 100,
115118
height: 100,

IntegrationTests/IntegrationTestHarnessTest.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
const requestAnimationFrame = require('fbjs/lib/requestAnimationFrame');
1414
const React = require('react');
1515
const ReactNative = require('react-native');
16-
const {Text, View} = ReactNative;
16+
const {Text, View, StyleSheet} = ReactNative;
1717
const {TestModule} = ReactNative.NativeModules;
1818

1919
type Props = $ReadOnly<{|
@@ -54,7 +54,7 @@ class IntegrationTestHarnessTest extends React.Component<Props, State> {
5454

5555
render() {
5656
return (
57-
<View style={{backgroundColor: 'white', padding: 40}}>
57+
<View style={styles.container}>
5858
<Text>
5959
{/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This
6060
* comment suppresses an error found when Flow v0.54 was deployed.
@@ -67,6 +67,13 @@ class IntegrationTestHarnessTest extends React.Component<Props, State> {
6767
}
6868
}
6969

70+
const styles = StyleSheet.create({
71+
container: {
72+
backgroundColor: 'white',
73+
padding: 40,
74+
},
75+
});
76+
7077
IntegrationTestHarnessTest.displayName = 'IntegrationTestHarnessTest';
7178

7279
module.exports = IntegrationTestHarnessTest;

IntegrationTests/SimpleSnapshotTest.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SimpleSnapshotTest extends React.Component<{}> {
3434

3535
render() {
3636
return (
37-
<View style={{backgroundColor: 'white', padding: 100}}>
37+
<View style={styles.container}>
3838
<View style={styles.box1} />
3939
<View style={styles.box2} />
4040
</View>
@@ -43,6 +43,10 @@ class SimpleSnapshotTest extends React.Component<{}> {
4343
}
4444

4545
const styles = StyleSheet.create({
46+
container: {
47+
backgroundColor: 'white',
48+
padding: 100,
49+
},
4650
box1: {
4751
width: 80,
4852
height: 50,

0 commit comments

Comments
 (0)