Skip to content

Commit

Permalink
feat(INJI-338): add testID for settings page (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth716 authored Sep 12, 2023
1 parent 3820906 commit ae7c187
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions components/ui/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const Modal: React.FC<ModalProps> = (props) => {
}}>
{props.headerRight ? (
<Icon
{...testIDProps('closeModal')}
name={I18nManager.isRTL ? 'chevron-right' : 'chevron-left'}
onPress={props.onDismiss}
color={Theme.Colors.Icon}
Expand Down
6 changes: 5 additions & 1 deletion components/ui/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ export const Picker: Picker = (props: PickerProps<unknown>) => {
isVisible={isContentVisible}
onBackdropPress={toggleContent}
overlayStyle={{ padding: 1 }}>
<Column width={Dimensions.get('window').width * 0.8}>
<Column
testID={props.testID}
width={Dimensions.get('window').width * 0.8}>
{props.items.map((item, index) => (
<ListItem
testID={item.value}
topDivider={index !== 0}
onPress={() => selectItem(index)}
key={index}>
Expand All @@ -54,6 +57,7 @@ export const Picker: Picker = (props: PickerProps<unknown>) => {
};

interface PickerProps<T> {
testID?: string;
items: PickerItem<T>[];
selectedValue: T;
triggerComponent: React.ReactElement;
Expand Down
8 changes: 5 additions & 3 deletions screens/Settings/AboutInji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Icon, ListItem } from 'react-native-elements';
import getAllConfigurations from '../../shared/commonprops/commonProps';
import { getVersion } from 'react-native-device-info';
import { CopyButton } from '../../components/CopyButton';
import testIDProps from '../../shared/commonUtil';

export const AboutInji: React.FC<AboutInjiProps> = ({ appId }) => {
const { t } = useTranslation('AboutInji');
Expand Down Expand Up @@ -62,22 +63,23 @@ export const AboutInji: React.FC<AboutInjiProps> = ({ appId }) => {
</ListItem>
</Pressable>
<Modal
testID="aboutInji"
isVisible={showAboutInji}
headerTitle={t('header')}
headerElevation={2}
headerRight={<Icon name={''} />}
headerRight={<Icon {...testIDProps('closeAboutInji')} name={''} />}
onDismiss={() => {
setShowAboutInji(!showAboutInji);
}}>
<Row style={Theme.Styles.primaryRow}>
<Row testID="appID" style={Theme.Styles.primaryRow}>
<Text style={Theme.TextStyles.semibold}>
{t('appID')} : {appId}
</Text>
<CopyButton content={appId} />
</Row>
<Column fill padding="12" align="space-between">
<Column>
<Text style={Theme.TextStyles.aboutDetailes}>
<Text testID="aboutDetails" style={Theme.TextStyles.aboutDetailes}>
{t('aboutDetailes')}
</Text>
<Row crossAlign="center">
Expand Down

0 comments on commit ae7c187

Please sign in to comment.