diff --git a/components/PinInput.tsx b/components/PinInput.tsx index 72cc68b3..3c538214 100644 --- a/components/PinInput.tsx +++ b/components/PinInput.tsx @@ -3,6 +3,7 @@ import { TextInput } from 'react-native'; import { usePinInput } from '../machines/pinInput'; import { Row } from './ui'; import { Theme } from './ui/styleUtils'; +import testID from '../shared/commonUtil'; export const PinInput: React.FC = (props) => { const { state, send, events } = usePinInput(props.length); @@ -16,7 +17,7 @@ export const PinInput: React.FC = (props) => { }, [state]); return ( - + {inputRefs.map((input, index) => ( = (props) => { const type = props.type || 'solid' || 'radius' || 'gradient'; @@ -58,6 +59,7 @@ export const Button: React.FC = (props) => { icon={props.icon} onPress={handleOnPress} loading={props.loading} + {...testID(props.testID)} /> ) : ( = (props) => { icon={props.icon} onPress={handleOnPress} loading={props.loading} + {...testID(props.testID)} /> ); }; diff --git a/components/ui/Layout.tsx b/components/ui/Layout.tsx index b24de54d..bb11deaf 100644 --- a/components/ui/Layout.tsx +++ b/components/ui/Layout.tsx @@ -10,6 +10,7 @@ import { SafeAreaView, } from 'react-native'; import { Theme, ElevationLevel, Spacing } from './styleUtils'; +import testID from '../../shared/commonUtil'; function createLayout( direction: FlexStyle['flexDirection'], @@ -49,11 +50,14 @@ function createLayout( return props.scroll ? ( + refreshControl={props.refreshControl} + {...testID(props.testID)}> {props.children} ) : ( - {props.children} + + {props.children} + ); }; @@ -73,6 +77,7 @@ export const HorizontallyCentered = createLayout( ); interface LayoutProps { + testID?: string; fill?: boolean; align?: FlexStyle['justifyContent']; crossAlign?: FlexStyle['alignItems']; diff --git a/components/ui/Text.tsx b/components/ui/Text.tsx index 047ed20a..5702b003 100644 --- a/components/ui/Text.tsx +++ b/components/ui/Text.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { StyleProp, TextStyle, Text as RNText } from 'react-native'; import { Theme, Spacing } from './styleUtils'; +import testID from '../../shared/commonUtil'; export const Text: React.FC = (props: TextProps) => { const weight = props.weight || 'regular'; @@ -16,7 +17,7 @@ export const Text: React.FC = (props: TextProps) => { ]; return ( - + {props.children} ); diff --git a/screens/Home/MyVcsTab.tsx b/screens/Home/MyVcsTab.tsx index 294b95b2..1c2dc69b 100644 --- a/screens/Home/MyVcsTab.tsx +++ b/screens/Home/MyVcsTab.tsx @@ -14,6 +14,7 @@ import { MessageOverlay, } from '../../components/MessageOverlay'; import { Icon } from 'react-native-elements'; +import testID from '../../shared/commonUtil'; export const MyVcsTab: React.FC = (props) => { const { t } = useTranslation('MyVcsTab'); @@ -131,6 +132,7 @@ export const MyVcsTab: React.FC = (props) => { {t('generateVcDescription')}