From 1d62e94b854f13a6818035f7acfda66e8bcb9e9c Mon Sep 17 00:00:00 2001 From: Ignacio Olaciregui Date: Tue, 6 Nov 2018 13:48:40 -0800 Subject: [PATCH] Fix inline styles in IntegrationTests (#22165) Summary: Fix `react-native/no-inline-styles` eslint warning for IntegrationTests module. Pull Request resolved: https://github.com/facebook/react-native/pull/22165 Differential Revision: D12946915 Pulled By: TheSavior fbshipit-source-id: 438bb74cc34dd5893f725e4865568715ce949c3a --- IntegrationTests/AsyncStorageTest.js | 11 +++++++++-- IntegrationTests/ImageCachePolicyTest.js | 5 ++++- IntegrationTests/IntegrationTestHarnessTest.js | 11 +++++++++-- IntegrationTests/SimpleSnapshotTest.js | 6 +++++- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/IntegrationTests/AsyncStorageTest.js b/IntegrationTests/AsyncStorageTest.js index da762ea01ced87..bcd0abe07bbaea 100644 --- a/IntegrationTests/AsyncStorageTest.js +++ b/IntegrationTests/AsyncStorageTest.js @@ -12,7 +12,7 @@ const React = require('react'); const ReactNative = require('react-native'); -const {AsyncStorage, Text, View} = ReactNative; +const {AsyncStorage, Text, View, StyleSheet} = ReactNative; const {TestModule} = ReactNative.NativeModules; const deepDiffer = require('deepDiffer'); @@ -191,7 +191,7 @@ class AsyncStorageTest extends React.Component<{}, $FlowFixMeState> { render() { return ( - + {/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This * comment suppresses an error found when Flow v0.54 was deployed. @@ -205,6 +205,13 @@ class AsyncStorageTest extends React.Component<{}, $FlowFixMeState> { } } +const styles = StyleSheet.create({ + container: { + backgroundColor: 'white', + padding: 40, + }, +}); + AsyncStorageTest.displayName = 'AsyncStorageTest'; module.exports = AsyncStorageTest; diff --git a/IntegrationTests/ImageCachePolicyTest.js b/IntegrationTests/ImageCachePolicyTest.js index 61909b6b0414e2..0dae9812cf6e24 100644 --- a/IntegrationTests/ImageCachePolicyTest.js +++ b/IntegrationTests/ImageCachePolicyTest.js @@ -58,7 +58,7 @@ class ImageCachePolicyTest extends React.Component { render() { return ( - + Hello { } const styles = StyleSheet.create({ + container: { + flex: 1, + }, base: { width: 100, height: 100, diff --git a/IntegrationTests/IntegrationTestHarnessTest.js b/IntegrationTests/IntegrationTestHarnessTest.js index e1469dda1b418a..efe6cd4cd2f643 100644 --- a/IntegrationTests/IntegrationTestHarnessTest.js +++ b/IntegrationTests/IntegrationTestHarnessTest.js @@ -13,7 +13,7 @@ const requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); const React = require('react'); const ReactNative = require('react-native'); -const {Text, View} = ReactNative; +const {Text, View, StyleSheet} = ReactNative; const {TestModule} = ReactNative.NativeModules; type Props = $ReadOnly<{| @@ -54,7 +54,7 @@ class IntegrationTestHarnessTest extends React.Component { render() { return ( - + {/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This * comment suppresses an error found when Flow v0.54 was deployed. @@ -67,6 +67,13 @@ class IntegrationTestHarnessTest extends React.Component { } } +const styles = StyleSheet.create({ + container: { + backgroundColor: 'white', + padding: 40, + }, +}); + IntegrationTestHarnessTest.displayName = 'IntegrationTestHarnessTest'; module.exports = IntegrationTestHarnessTest; diff --git a/IntegrationTests/SimpleSnapshotTest.js b/IntegrationTests/SimpleSnapshotTest.js index e8f530311b3794..fef8377373d0f6 100644 --- a/IntegrationTests/SimpleSnapshotTest.js +++ b/IntegrationTests/SimpleSnapshotTest.js @@ -34,7 +34,7 @@ class SimpleSnapshotTest extends React.Component<{}> { render() { return ( - + @@ -43,6 +43,10 @@ class SimpleSnapshotTest extends React.Component<{}> { } const styles = StyleSheet.create({ + container: { + backgroundColor: 'white', + padding: 100, + }, box1: { width: 80, height: 50,