Files
inji-wallet/screens/Settings/__snapshots__/SettingScreen.test.tsx.snap
Harsh Vardhan c05408413d [INJI-314] [INJI-900] add jest testing config, mocks and sample unit tests for Inji (#1340)
* [INJI-314] initial commit

Signed-off-by: Sri Kanth Kola <srikanthsri7447@gmail.com>

* [INJI-314] add WIP ut stuff

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-314] fix tsconfig for project type

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-314] kludge - skip checking types during unit tests

* mock image imports globally
* enable tests to run from any dir

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-314]: mocked modules

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>

* [INJIMOB-314]: mock react-native-google-signin

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>

* [INJIMOB-314]: use defined mock from google-signin lib

other details:
- mock base58.., rn-linear-gradient, expo-camera
- add @react-native/assets-registry to make jest-expo babel preset work

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-314] reorganise global const mocks into jest's setupFiles

Co-authored-by: srikanth716 <srikanthsri7447@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900] write tests for ActivityLogEvent

* init relevant mocks
* remove redundant global mocks from test files

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900] fixup mocks of mmkv, zip-archive, rnfs

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900]: write unit test for commonUtil

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>

* [INJIMOB-900]: write unit test for commonUtil

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>

* [INJIMOB-900]: sample unit test for settingsScreen

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>

* [INJIMOB-900] add SettingScreen test

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900] update sample tests for commonUtil

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900]: refactoring the settingsScreen test for Android and IOS

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>

* [INJIMOB-900] update test snapshots and add kludge in auth for testing

kludge: auth state machine now exports a selector with optional fields
as state machine isn't running in a test environment

Co-authored-by: srikanth716 <srikanthsri7447@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900]: snapshot test to settings screen

Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>

* [INJIMOB-900] update mocks for testing and ACK reviews

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900] downgrade expo to match compatibility matrix

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900] upgrade expo to 49 to build the iOS app(kludge)

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJIMOB-900] configure react-native-vector-icons as per README

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

---------

Signed-off-by: Sri Kanth Kola <srikanthsri7447@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
Signed-off-by: srikanth716 <srikanthsri7447@gmail.com>
Co-authored-by: Sri Kanth Kola <srikanthsri7447@gmail.com>
2024-04-02 11:22:01 +05:30

410 lines
8.9 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`testing the settingsScreen component in Android and IOS renders the SettingScreen component in IOS 1`] = `
<React.Fragment>
<Memo(Pressable)
accessible={false}
onPress={[Function]}
/>
<BannerNotificationContainer />
<mockConstructor
accessibilityLabel="settingsScreen"
accessible={true}
>
<Layout
backgroundColor="#F8F8F8"
style={
{
"display": "flex",
}
}
>
<Text
color="#666666"
margin="10"
style={
{
"paddingTop": 3,
}
}
testID="injiAsVerifierApp"
weight="semibold"
>
injiAsVerifierApp
</Text>
<Layout
align="space-evenly"
backgroundColor="#FFFFFF"
>
<Memo(Pressable)
accessibilityLabel="receiveCardPressableArea"
accessible={true}
onPress={[Function]}
>
<Layout
align="center"
style={
{
"alignItems": "center",
"borderBottomRightRadius": 0,
"elevation": 1,
"height": 186.76000000000002,
"marginVertical": 18,
"padding": 15,
"width": 352.5,
}
}
>
<UNDEFINED
color1="#f59b4b"
color2="#e86e04"
stroke="#F2811D"
/>
<Text
margin="6"
style={
{
"paddingTop": 3,
}
}
testID="receiveCard"
weight="semibold"
>
receiveCard
</Text>
</Layout>
</Memo(Pressable)>
<ReceivedCards />
</Layout>
<Text
color="#666666"
margin="10"
style={
{
"paddingTop": 3,
}
}
weight="semibold"
>
basicSettings
</Text>
</Layout>
<Layout
fill={true}
>
<MessageOverlay
isVisible={false}
onBackdropPress={[Function]}
title=""
/>
<LanguageSetting />
<UNDEFINED
disabled={true}
topDivider={true}
>
<mockConstructor
color="#F2811D"
name="fingerprint"
size={25}
type="MaterialCommunityIcons"
/>
<Content>
<UNDEFINED
accessibilityLabel="bioUnlock"
accessible={true}
style={
{
"paddingTop": 3,
}
}
>
<Text
color="#000000"
weight="semibold"
>
bioUnlock
</Text>
</UNDEFINED>
</Content>
<UNDEFINED
accessibilityLabel="biometricToggle"
accessible={true}
color="#F2811D"
onValueChange={[Function]}
trackColor={
{
"false": "#C7C7C7",
"true": "#FDF1E6",
}
}
/>
</UNDEFINED>
<AboutInji />
<Unknown />
<UNDEFINED
bottomDivider={true}
onPress={[Function]}
topDivider={true}
>
<mockConstructor
color="#F2811D"
name="book"
size={25}
type="antdesign"
/>
<Content>
<UNDEFINED
accessibilityLabel="injiTourGuide"
accessible={true}
style={
{
"paddingTop": 3,
}
}
>
<Text
color="#000000"
weight="semibold"
>
injiTourGuide
</Text>
</UNDEFINED>
</Content>
</UNDEFINED>
<UNDEFINED
onPress={[Function]}
>
<mockConstructor
color="#F2811D"
name="logout"
size={22}
type="fontawesome"
/>
<Content>
<UNDEFINED
accessibilityLabel="logout"
accessible={true}
style={
{
"paddingTop": 3,
}
}
>
<Text
color="#000000"
weight="semibold"
>
logout
</Text>
</UNDEFINED>
</Content>
</UNDEFINED>
</Layout>
</mockConstructor>
</React.Fragment>
`;
exports[`testing the settingsScreen component in Android and IOS renders the SettingScreen component in android 1`] = `
<React.Fragment>
<Memo(Pressable)
accessible={false}
onPress={[Function]}
/>
<BannerNotificationContainer />
<mockConstructor
accessibilityLabel="settingsScreen"
accessible={true}
>
<Layout
backgroundColor="#F8F8F8"
style={
{
"display": "flex",
}
}
>
<Text
color="#666666"
margin="10"
style={
{
"paddingTop": 3,
}
}
testID="injiAsVerifierApp"
weight="semibold"
>
injiAsVerifierApp
</Text>
<Layout
align="space-evenly"
backgroundColor="#FFFFFF"
>
<Memo(Pressable)
accessibilityLabel="receiveCardPressableArea"
accessible={true}
onPress={[Function]}
>
<Layout
align="center"
style={
{
"alignItems": "center",
"borderBottomRightRadius": 0,
"elevation": 1,
"height": 186.76000000000002,
"marginVertical": 18,
"padding": 15,
"width": 352.5,
}
}
>
<UNDEFINED
color1="#f59b4b"
color2="#e86e04"
stroke="#F2811D"
/>
<Text
margin="6"
style={
{
"paddingTop": 3,
}
}
testID="receiveCard"
weight="semibold"
>
receiveCard
</Text>
</Layout>
</Memo(Pressable)>
<ReceivedCards />
</Layout>
<Text
color="#666666"
margin="10"
style={
{
"paddingTop": 3,
}
}
weight="semibold"
>
basicSettings
</Text>
</Layout>
<Layout
fill={true}
>
<MessageOverlay
isVisible={false}
onBackdropPress={[Function]}
title=""
/>
<LanguageSetting />
<UNDEFINED
disabled={true}
topDivider={true}
>
<mockConstructor
color="#F2811D"
name="fingerprint"
size={25}
type="MaterialCommunityIcons"
/>
<Content>
<UNDEFINED
accessibilityLabel="bioUnlock"
accessible={true}
style={
{
"paddingTop": 3,
}
}
>
<Text
color="#000000"
weight="semibold"
>
bioUnlock
</Text>
</UNDEFINED>
</Content>
<UNDEFINED
accessibilityLabel="biometricToggle"
accessible={true}
color="#F2811D"
onValueChange={[Function]}
trackColor={
{
"false": "#C7C7C7",
"true": "#FDF1E6",
}
}
/>
</UNDEFINED>
<AboutInji />
<Unknown />
<UNDEFINED
bottomDivider={true}
onPress={[Function]}
topDivider={true}
>
<mockConstructor
color="#F2811D"
name="book"
size={25}
type="antdesign"
/>
<Content>
<UNDEFINED
accessibilityLabel="injiTourGuide"
accessible={true}
style={
{
"paddingTop": 3,
}
}
>
<Text
color="#000000"
weight="semibold"
>
injiTourGuide
</Text>
</UNDEFINED>
</Content>
</UNDEFINED>
<UNDEFINED
onPress={[Function]}
>
<mockConstructor
color="#F2811D"
name="logout"
size={22}
type="fontawesome"
/>
<Content>
<UNDEFINED
accessibilityLabel="logout"
accessible={true}
style={
{
"paddingTop": 3,
}
}
>
<Text
color="#000000"
weight="semibold"
>
logout
</Text>
</UNDEFINED>
</Content>
</UNDEFINED>
</Layout>
</mockConstructor>
</React.Fragment>
`;