Unit testing (#32)

* add testing lib

* remove coverage folder from git

* finished basic test setup

* fix tests typescript and import paths

* add first snapshot

* testing utils

* rename test files; update script flags; ++tests

* testing utils functions

* testing downloadAndResize wip

* remove download test

* specify unwanted coverage paths;
remove update snapshots flag

* fix strings tests

* testing downloadAndResize method

* increasing testing

* fixing snapshots wip

* fixed shell mobile snapshot

* adding snapshots for the screens

* fix onboard snapshot

* fix typescript issues

* fix TabsSelector snapshot

* Account for testing device's locale in ago() tests

* Remove platform detection on regex

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
João Ferreiro 2022-12-22 15:32:39 +00:00 committed by GitHub
parent 4913a07e33
commit 7517b65dcd
60 changed files with 10409 additions and 34 deletions

View file

@ -0,0 +1,371 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Login renders correctly 1`] = `
<View
style={
Object {
"flex": 1,
}
}
>
<View
style={
Object {
"flex": 2,
"justifyContent": "center",
}
}
>
<View
style={
Object {
"flexDirection": "row",
"justifyContent": "center",
}
}
>
<RNSVGSvgView
bbHeight="100"
bbWidth="100"
focusable={false}
height="100"
style={
Array [
Object {
"backgroundColor": "transparent",
"borderWidth": 0,
},
Object {
"flex": 0,
"height": 100,
"width": 100,
},
]
}
width="100"
>
<RNSVGGroup>
<RNSVGCircle
cx="50"
cy="50"
fill={null}
propList={
Array [
"fill",
"stroke",
"strokeWidth",
]
}
r="46"
stroke={4294967295}
strokeWidth={2}
/>
<RNSVGLine
propList={
Array [
"stroke",
"strokeWidth",
]
}
stroke={4294967295}
strokeWidth={1}
x1="30"
x2="30"
y1="0"
y2="100"
/>
<RNSVGLine
propList={
Array [
"stroke",
"strokeWidth",
]
}
stroke={4294967295}
strokeWidth={1}
x1="74"
x2="74"
y1="0"
y2="100"
/>
<RNSVGLine
propList={
Array [
"stroke",
"strokeWidth",
]
}
stroke={4294967295}
strokeWidth={1}
x1="0"
x2="100"
y1="22"
y2="22"
/>
<RNSVGLine
propList={
Array [
"stroke",
"strokeWidth",
]
}
stroke={4294967295}
strokeWidth={1}
x1="0"
x2="100"
y1="74"
y2="74"
/>
<RNSVGText
content={null}
dx={Array []}
dy={Array []}
fill={null}
font={
Object {
"fontSize": "60",
"fontWeight": "bold",
"textAnchor": "middle",
}
}
propList={
Array [
"fill",
"stroke",
"strokeWidth",
]
}
rotate={Array []}
stroke={4294967295}
strokeWidth={2}
x={
Array [
"52",
]
}
y={
Array [
"70",
]
}
>
<RNSVGTSpan
content="B"
dx={Array []}
dy={Array []}
font={Object {}}
rotate={Array []}
x={Array []}
y={Array []}
/>
</RNSVGText>
</RNSVGGroup>
</RNSVGSvgView>
</View>
<Text
style={
Array [
Object {
"color": "#000000",
},
Object {
"color": "#ffffff",
"fontSize": 68,
"fontWeight": "bold",
"textAlign": "center",
},
]
}
>
Bluesky
</Text>
<Text
style={
Array [
Object {
"color": "#000000",
},
Object {
"color": "#ffffff",
"fontSize": 18,
"textAlign": "center",
},
]
}
>
[ private beta ]
</Text>
</View>
<View
style={
Object {
"flex": 1,
}
}
>
<View
accessible={true}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"backgroundColor": "#0085ff",
"borderColor": "#ffffff",
"borderRadius": 10,
"borderWidth": 1,
"marginBottom": 20,
"marginHorizontal": 20,
"opacity": 1,
"paddingVertical": 16,
}
}
>
<Text
style={
Array [
Object {
"color": "#000000",
},
Object {
"color": "#ffffff",
"fontSize": 18,
"fontWeight": "bold",
"textAlign": "center",
},
]
}
>
Create a new account
</Text>
</View>
<View
style={
Object {
"marginBottom": 20,
}
}
>
<RNSVGSvgView
bbHeight="1"
bbWidth={750}
focusable={false}
height="1"
style={
Array [
Object {
"backgroundColor": "transparent",
"borderWidth": 0,
},
Object {
"position": "absolute",
"top": 10,
},
Object {
"flex": 0,
"height": 1,
"width": 750,
},
]
}
width={750}
>
<RNSVGGroup>
<RNSVGLine
propList={
Array [
"stroke",
"strokeWidth",
]
}
stroke={4294967295}
strokeWidth="1"
x1="30"
x2={355}
y1="0"
y2="0"
/>
<RNSVGLine
propList={
Array [
"stroke",
"strokeWidth",
]
}
stroke={4294967295}
strokeWidth="1"
x1={395}
x2={720}
y1="0"
y2="0"
/>
</RNSVGGroup>
</RNSVGSvgView>
<Text
style={
Array [
Object {
"color": "#000000",
},
Object {
"color": "#ffffff",
"fontSize": 16,
"textAlign": "center",
},
]
}
>
or
</Text>
</View>
<View
accessible={true}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"backgroundColor": "#0085ff",
"borderColor": "#ffffff",
"borderRadius": 10,
"borderWidth": 1,
"marginBottom": 20,
"marginHorizontal": 20,
"opacity": 1,
"paddingVertical": 16,
}
}
>
<Text
style={
Array [
Object {
"color": "#000000",
},
Object {
"color": "#ffffff",
"fontSize": 18,
"fontWeight": "bold",
"textAlign": "center",
},
]
}
>
Sign in
</Text>
</View>
</View>
</View>
`;