This repository was archived by the owner on Jul 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { View } from 'react-native' ;
2+ import { SafeAreaView , View } from 'react-native' ;
3+
34import { cleanup , toJSON , render } from '../' ;
45
56afterEach ( cleanup ) ;
@@ -15,7 +16,9 @@ test('returns container', () => {
1516} ) ;
1617
1718test ( 'renders options.wrapper around node' , ( ) => {
18- const WrapperComponent = ( { children } ) => < View testID = "wrapper" > { children } </ View > ;
19+ const WrapperComponent = ( { children } ) => (
20+ < SafeAreaView testID = "wrapper" > { children } </ SafeAreaView >
21+ ) ;
1922
2023 const { container, getByTestId } = render ( < View testID = "inner" /> , {
2124 wrapper : WrapperComponent ,
@@ -26,13 +29,13 @@ test('renders options.wrapper around node', () => {
2629 <View
2730 testID="ntl-container"
2831 >
29- <View
32+ <SafeAreaView
3033 testID="wrapper"
3134 >
3235 <View
3336 testID="inner"
3437 />
35- </View >
38+ </SafeAreaView >
3639 </View>
3740 ` ) ;
3841} ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function toJSON(node) {
2424
2525 // Hoist children so that only "native elements" are in the output
2626 if ( typeof node . type !== 'string' ) {
27- return renderedChildren ;
27+ return renderedChildren . length === 1 ? renderedChildren [ 0 ] : renderedChildren ;
2828 }
2929
3030 // Function props get noisy in debug output, so we'll exclude them
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ configureNTL({
1919 'Modal' ,
2020 'Picker' ,
2121 'RefreshControl' ,
22+ 'SafeAreaView' ,
2223 'ScrollView' ,
2324 'Switch' ,
2425 'Text' ,
You can’t perform that action at this time.
0 commit comments