test: fix snapshots

This commit is contained in:
satyajit.happy
2019-10-06 05:32:45 +02:00
parent 4d0a1a5178
commit ca6cc3048d
2 changed files with 1263 additions and 21 deletions

View File

@@ -1,14 +1,625 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Nested navigators renders succesfully as direct child 1`] = `
<RNCSafeAreaView
onInsetsChange={[Function]}
style={
Object {
"flex": 1,
Array [
<View
onLayout={[Function]}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
}
/>
>
<View
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
closing={false}
gestureVelocityImpact={0.3}
importantForAccessibility="auto"
onClose={[Function]}
onGestureBegin={[Function]}
onGestureCanceled={[Function]}
onOpen={[Function]}
onTransitionStart={[Function]}
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
transitionSpec={
Object {
"close": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
"open": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
}
}
>
<View
pointerEvents="box-none"
style={
Array [
Object {
"flex": 1,
},
undefined,
Object {
"marginTop": 44,
},
]
}
>
<PanGestureHandler
enabled={false}
hitSlop={
Object {
"right": -700,
}
}
maxDeltaY={20}
minOffsetX={5}
>
<View
style={
Array [
Object {
"flex": 1,
},
Object {
"transform": Array [
Object {
"translateX": undefined,
},
Object {
"translateX": 0,
},
],
},
]
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"backgroundColor": "#fff",
"position": "absolute",
"shadowColor": "#000",
"shadowOpacity": 0.3,
"shadowRadius": 5,
},
Object {
"bottom": 0,
"left": 0,
"shadowOffset": Object {
"height": 1,
"width": -1,
},
"top": 0,
"width": 3,
},
Object {
"shadowOpacity": undefined,
},
]
}
/>
<View
style={
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
null,
Object {
"backgroundColor": "#eee",
},
undefined,
]
}
>
<View
style={
Object {
"flex": 1,
"flexDirection": "column-reverse",
}
}
>
<View
style={
Object {
"flex": 1,
}
}
>
<View
onLayout={[Function]}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
<View
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
closing={false}
gestureVelocityImpact={0.3}
importantForAccessibility="auto"
onClose={[Function]}
onGestureBegin={[Function]}
onGestureCanceled={[Function]}
onOpen={[Function]}
onTransitionStart={[Function]}
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
transitionSpec={
Object {
"close": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
"open": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
}
}
>
<View
pointerEvents="box-none"
style={
Array [
Object {
"flex": 1,
},
undefined,
Object {
"marginTop": 44,
},
]
}
>
<PanGestureHandler
enabled={false}
hitSlop={
Object {
"right": -700,
}
}
maxDeltaY={20}
minOffsetX={5}
>
<View
style={
Array [
Object {
"flex": 1,
},
Object {
"transform": Array [
Object {
"translateX": undefined,
},
Object {
"translateX": 0,
},
],
},
]
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"backgroundColor": "#fff",
"position": "absolute",
"shadowColor": "#000",
"shadowOpacity": 0.3,
"shadowRadius": 5,
},
Object {
"bottom": 0,
"left": 0,
"shadowOffset": Object {
"height": 1,
"width": -1,
},
"top": 0,
"width": 3,
},
Object {
"shadowOpacity": undefined,
},
]
}
/>
<View
style={
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
null,
Object {
"backgroundColor": "#eee",
},
undefined,
]
}
>
<View
style={
Object {
"flex": 1,
"flexDirection": "column-reverse",
}
}
>
<View
style={
Object {
"flex": 1,
}
}
/>
</View>
</View>
</View>
</PanGestureHandler>
</View>
</View>
</View>
</View>
<View
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
importantForAccessibility="auto"
onLayout={[Function]}
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"opacity": undefined,
},
]
}
>
<View
style={
Array [
Object {
"backgroundColor": "white",
"flex": 1,
"shadowColor": "rgba(0, 0, 0, 0.3)",
"shadowOffset": Object {
"height": 0.5,
"width": 0,
},
"shadowOpacity": 0.85,
"shadowRadius": 0,
},
Object {},
]
}
/>
</View>
<View
pointerEvents="box-none"
style={
Array [
Object {
"height": 44,
"maxHeight": undefined,
"minHeight": undefined,
"opacity": undefined,
},
]
}
>
<View
pointerEvents="none"
style={
Object {
"height": 0,
}
}
/>
<View
pointerEvents="box-none"
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"paddingHorizontal": 4,
}
}
>
<View
pointerEvents="box-none"
style={
Array [
null,
Object {},
Object {
"opacity": undefined,
},
undefined,
]
}
>
<Text
onLayout={[Function]}
style={
Array [
Object {
"color": "rgba(0, 0, 0, .9)",
"fontSize": 17,
"fontWeight": "600",
},
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>
Home
</Text>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</PanGestureHandler>
</View>
</View>
</View>
</View>,
<View
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
importantForAccessibility="auto"
onLayout={[Function]}
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"opacity": undefined,
},
]
}
>
<View
style={
Array [
Object {
"backgroundColor": "white",
"flex": 1,
"shadowColor": "rgba(0, 0, 0, 0.3)",
"shadowOffset": Object {
"height": 0.5,
"width": 0,
},
"shadowOpacity": 0.85,
"shadowRadius": 0,
},
Object {},
]
}
/>
</View>
<View
pointerEvents="box-none"
style={
Array [
Object {
"height": 44,
"maxHeight": undefined,
"minHeight": undefined,
"opacity": undefined,
},
]
}
>
<View
pointerEvents="none"
style={
Object {
"height": 0,
}
}
/>
<View
pointerEvents="box-none"
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"paddingHorizontal": 4,
}
}
>
<View
pointerEvents="box-none"
style={
Array [
null,
Object {},
Object {
"opacity": undefined,
},
undefined,
]
}
>
<Text
onLayout={[Function]}
style={
Array [
Object {
"color": "rgba(0, 0, 0, .9)",
"fontSize": 17,
"fontWeight": "600",
},
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>
Sub
</Text>
</View>
</View>
</View>
</View>
</View>,
]
`;
exports[`Nested navigators throw when trying to pass navigation prop 1`] = `"No \\"routes\\" found in navigation state. Did you try to pass the navigation prop of a React component to a Navigator child? See https://reactnavigation.org/docs/en/custom-navigators.html#navigator-navigation-prop"`;

View File

@@ -1,23 +1,654 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`StackNavigator applies correct values when headerRight is present 1`] = `
<RNCSafeAreaView
onInsetsChange={[Function]}
style={
Object {
"flex": 1,
Array [
<View
onLayout={[Function]}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
}
/>
>
<View
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
closing={false}
gestureVelocityImpact={0.3}
importantForAccessibility="auto"
onClose={[Function]}
onGestureBegin={[Function]}
onGestureCanceled={[Function]}
onOpen={[Function]}
onTransitionStart={[Function]}
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
transitionSpec={
Object {
"close": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
"open": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
}
}
>
<View
pointerEvents="box-none"
style={
Array [
Object {
"flex": 1,
},
undefined,
Object {
"marginTop": 44,
},
]
}
>
<PanGestureHandler
enabled={false}
hitSlop={
Object {
"right": -700,
}
}
maxDeltaY={20}
minOffsetX={5}
>
<View
style={
Array [
Object {
"flex": 1,
},
Object {
"transform": Array [
Object {
"translateX": undefined,
},
Object {
"translateX": 0,
},
],
},
]
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"backgroundColor": "#fff",
"position": "absolute",
"shadowColor": "#000",
"shadowOpacity": 0.3,
"shadowRadius": 5,
},
Object {
"bottom": 0,
"left": 0,
"shadowOffset": Object {
"height": 1,
"width": -1,
},
"top": 0,
"width": 3,
},
Object {
"shadowOpacity": undefined,
},
]
}
/>
<View
style={
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
null,
Object {
"backgroundColor": "#eee",
},
undefined,
]
}
>
<View
style={
Object {
"flex": 1,
"flexDirection": "column-reverse",
}
}
>
<View
style={
Object {
"flex": 1,
}
}
/>
</View>
</View>
</View>
</PanGestureHandler>
</View>
</View>
</View>
</View>,
<View
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
importantForAccessibility="auto"
onLayout={[Function]}
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"opacity": undefined,
},
]
}
>
<View
style={
Array [
Object {
"backgroundColor": "white",
"flex": 1,
"shadowColor": "rgba(0, 0, 0, 0.3)",
"shadowOffset": Object {
"height": 0.5,
"width": 0,
},
"shadowOpacity": 0.85,
"shadowRadius": 0,
},
Object {
"backgroundColor": "red",
"opacity": 0.5,
},
]
}
/>
</View>
<View
pointerEvents="box-none"
style={
Array [
Object {
"height": 44,
"maxHeight": undefined,
"minHeight": undefined,
"opacity": 0.5,
},
]
}
>
<View
pointerEvents="none"
style={
Object {
"height": 0,
}
}
/>
<View
pointerEvents="box-none"
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"paddingHorizontal": 4,
}
}
>
<View
pointerEvents="box-none"
style={
Array [
null,
Object {},
Object {
"opacity": undefined,
},
undefined,
]
}
>
<Text
onLayout={[Function]}
style={
Array [
Object {
"color": "rgba(0, 0, 0, .9)",
"fontSize": 17,
"fontWeight": "600",
},
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>
Welcome anonymous
</Text>
</View>
<View
pointerEvents="box-none"
style={
Array [
Object {
"alignItems": "flex-end",
"bottom": 0,
"justifyContent": "center",
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"opacity": undefined,
},
undefined,
]
}
>
<View />
</View>
</View>
</View>
</View>
</View>,
]
`;
exports[`StackNavigator renders successfully 1`] = `
<RNCSafeAreaView
onInsetsChange={[Function]}
style={
Object {
"flex": 1,
Array [
<View
onLayout={[Function]}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
}
/>
>
<View
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
closing={false}
gestureVelocityImpact={0.3}
importantForAccessibility="auto"
onClose={[Function]}
onGestureBegin={[Function]}
onGestureCanceled={[Function]}
onOpen={[Function]}
onTransitionStart={[Function]}
pointerEvents="box-none"
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
transitionSpec={
Object {
"close": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
"open": Object {
"animation": "spring",
"config": Object {
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"stiffness": 1000,
},
},
}
}
>
<View
pointerEvents="box-none"
style={
Array [
Object {
"flex": 1,
},
undefined,
Object {
"marginTop": 44,
},
]
}
>
<PanGestureHandler
enabled={false}
hitSlop={
Object {
"right": -700,
}
}
maxDeltaY={20}
minOffsetX={5}
>
<View
style={
Array [
Object {
"flex": 1,
},
Object {
"transform": Array [
Object {
"translateX": undefined,
},
Object {
"translateX": 0,
},
],
},
]
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"backgroundColor": "#fff",
"position": "absolute",
"shadowColor": "#000",
"shadowOpacity": 0.3,
"shadowRadius": 5,
},
Object {
"bottom": 0,
"left": 0,
"shadowOffset": Object {
"height": 1,
"width": -1,
},
"top": 0,
"width": 3,
},
Object {
"shadowOpacity": undefined,
},
]
}
/>
<View
style={
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
null,
Object {
"backgroundColor": "#eee",
},
undefined,
]
}
>
<View
style={
Object {
"flex": 1,
"flexDirection": "column-reverse",
}
}
>
<View
style={
Object {
"flex": 1,
}
}
/>
</View>
</View>
</View>
</PanGestureHandler>
</View>
</View>
</View>
</View>,
<View
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
accessibilityElementsHidden={false}
importantForAccessibility="auto"
onLayout={[Function]}
pointerEvents="box-none"
style={
Object {
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<View
pointerEvents="none"
style={
Array [
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"opacity": undefined,
},
]
}
>
<View
style={
Array [
Object {
"backgroundColor": "white",
"flex": 1,
"shadowColor": "rgba(0, 0, 0, 0.3)",
"shadowOffset": Object {
"height": 0.5,
"width": 0,
},
"shadowOpacity": 0.85,
"shadowRadius": 0,
},
Object {
"backgroundColor": "red",
"opacity": 0.5,
},
]
}
/>
</View>
<View
pointerEvents="box-none"
style={
Array [
Object {
"height": 44,
"maxHeight": undefined,
"minHeight": undefined,
"opacity": 0.5,
},
]
}
>
<View
pointerEvents="none"
style={
Object {
"height": 0,
}
}
/>
<View
pointerEvents="box-none"
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"paddingHorizontal": 4,
}
}
>
<View
pointerEvents="box-none"
style={
Array [
null,
Object {},
Object {
"opacity": undefined,
},
undefined,
]
}
>
<Text
onLayout={[Function]}
style={
Array [
Object {
"color": "rgba(0, 0, 0, .9)",
"fontSize": 17,
"fontWeight": "600",
},
Array [
Object {
"color": undefined,
},
undefined,
],
]
}
>
Welcome anonymous
</Text>
</View>
</View>
</View>
</View>
</View>,
]
`;