From 6644c300fdb5203ff9e96dc2822818e6cf1fc9ea Mon Sep 17 00:00:00 2001 From: srikanth716 <97477121+srikanth716@users.noreply.github.com> Date: Tue, 12 Sep 2023 13:01:34 +0530 Subject: [PATCH] fix(INJI-337)testID for home screen and settings screen (#805) * fix(INJI-337)testID for home screen and settings screen * fix(INJI-337)testID for home screen and settings screen * feat(INJI-337): refactor testID for home screen and settings screen * feat(INJI-337): refactor testID for home screen and settings screen * feat(INJI-337): refactor testID for home screen and settings screen Signed-off-by: Tilak Puli --- components/HelpScreen.tsx | 2 ++ components/LanguageSelector.tsx | 1 + components/ui/Modal.tsx | 7 ++++++- screens/Home/MyVcsTab.tsx | 1 + screens/MainLayout.tsx | 4 ++++ screens/Settings/AboutInji.tsx | 2 +- screens/Settings/ReceivedCards.tsx | 15 ++++++++++++--- screens/Settings/SettingScreen.tsx | 20 ++++++++++++++++---- 8 files changed, 43 insertions(+), 9 deletions(-) diff --git a/components/HelpScreen.tsx b/components/HelpScreen.tsx index ee71fc7faa..3ed74ce8a5 100644 --- a/components/HelpScreen.tsx +++ b/components/HelpScreen.tsx @@ -23,6 +23,7 @@ export const HelpScreen: React.FC = ( {props.triggerComponent} = ( }; interface HelpScreenProps { + testID?: string; triggerComponent: React.ReactElement; } diff --git a/components/LanguageSelector.tsx b/components/LanguageSelector.tsx index 33ff3dc3f1..7ddde79e69 100644 --- a/components/LanguageSelector.tsx +++ b/components/LanguageSelector.tsx @@ -35,6 +35,7 @@ export const LanguageSelector: React.FC = (props) => { return ( = (props) => { const controller = useSendVcScreen(); return ( = (props) => { ) : null} {props.arrowLeft ? ( = (props) => { align={props.headerLeft ? 'flex-start' : 'center'} margin={'16 0 0 0'}> - + {props.headerTitle || props.headerLeft} {!props.requester ? ( @@ -73,6 +76,7 @@ export const Modal: React.FC = (props) => { {props.headerRight || props.arrowLeft || ( = (props) => { }; export interface ModalProps { + testID?: string; isVisible: boolean; requester?: boolean; onDismiss?: () => void; diff --git a/screens/Home/MyVcsTab.tsx b/screens/Home/MyVcsTab.tsx index 76b6737152..8493884a0b 100644 --- a/screens/Home/MyVcsTab.tsx +++ b/screens/Home/MyVcsTab.tsx @@ -117,6 +117,7 @@ export const MyVcsTab: React.FC = (props) => { = ( @@ -30,6 +31,7 @@ export const MainLayout: React.FC = ( @@ -41,6 +43,7 @@ export const MainLayout: React.FC = ( = ( title: t(route.name), tabBarIcon: ({ focused }) => ( = ({ appId }) => { onPress={() => { setShowAboutInji(!showAboutInji); }}> - + { return ( - + { size={40} name="sentiment-dissatisfied" /> - + {t('noReceivedVcsTitle')} - + {t('noReceivedVcsText')} diff --git a/screens/Settings/SettingScreen.tsx b/screens/Settings/SettingScreen.tsx index 116329d4bf..e8357ea6d0 100644 --- a/screens/Settings/SettingScreen.tsx +++ b/screens/Settings/SettingScreen.tsx @@ -15,6 +15,7 @@ import { AboutInji } from './AboutInji'; import { EditableListItem } from '../../components/EditableListItem'; import { RequestRouteProps, RootRouteProps } from '../../routes'; import { ReceivedCards } from './ReceivedCards'; +import testIDProps from '../../shared/commonUtil'; const LanguageSetting: React.FC = () => { const { t } = useTranslation('SettingScreen'); @@ -22,7 +23,7 @@ const LanguageSetting: React.FC = () => { return ( + } headerTitle={t('header')} @@ -69,6 +71,7 @@ export const SettingScreen: React.FC< style={{ display: Platform.OS !== 'ios' ? 'flex' : 'none' }} backgroundColor={Theme.Colors.lightGreyBackgroundColor}> @@ -78,7 +81,9 @@ export const SettingScreen: React.FC< align="space-evenly" backgroundColor={Theme.Colors.whiteBackgroundColor}> - + + @@ -107,7 +113,10 @@ export const SettingScreen: React.FC< - + controller.INJI_TOUR_GUIDE()}> @@ -173,7 +183,7 @@ export const SettingScreen: React.FC< - + + {controller.backendInfo.application.name !== '' ? (