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 1
1
import React from 'react' ;
2
- import { View } from 'react-native' ;
2
+ import { SafeAreaView , View } from 'react-native' ;
3
+
3
4
import { cleanup , toJSON , render } from '../' ;
4
5
5
6
afterEach ( cleanup ) ;
@@ -15,7 +16,9 @@ test('returns container', () => {
15
16
} ) ;
16
17
17
18
test ( '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
+ ) ;
19
22
20
23
const { container, getByTestId } = render ( < View testID = "inner" /> , {
21
24
wrapper : WrapperComponent ,
@@ -26,13 +29,13 @@ test('renders options.wrapper around node', () => {
26
29
<View
27
30
testID="ntl-container"
28
31
>
29
- <View
32
+ <SafeAreaView
30
33
testID="wrapper"
31
34
>
32
35
<View
33
36
testID="inner"
34
37
/>
35
- </View >
38
+ </SafeAreaView >
36
39
</View>
37
40
` ) ;
38
41
} ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ function toJSON(node) {
24
24
25
25
// Hoist children so that only "native elements" are in the output
26
26
if ( typeof node . type !== 'string' ) {
27
- return renderedChildren ;
27
+ return renderedChildren . length === 1 ? renderedChildren [ 0 ] : renderedChildren ;
28
28
}
29
29
30
30
// 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({
19
19
'Modal' ,
20
20
'Picker' ,
21
21
'RefreshControl' ,
22
+ 'SafeAreaView' ,
22
23
'ScrollView' ,
23
24
'Switch' ,
24
25
'Text' ,
You can’t perform that action at this time.
0 commit comments