mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
feat(INJI-334): rename testID function to testIDProps
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
import { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
|
||||
import { Text } from './Text';
|
||||
import { Theme, Spacing } from './styleUtils';
|
||||
import testID from '../../shared/commonUtil';
|
||||
import testIDProps from '../../shared/commonUtil';
|
||||
|
||||
export const Button: React.FC<ButtonProps> = (props) => {
|
||||
const type = props.type || 'solid' || 'radius' || 'gradient';
|
||||
@@ -34,6 +34,7 @@ export const Button: React.FC<ButtonProps> = (props) => {
|
||||
|
||||
return !(type === 'gradient') ? (
|
||||
<RNEButton
|
||||
{...testIDProps(props.testID)}
|
||||
buttonStyle={buttonStyle}
|
||||
containerStyle={[
|
||||
props.fill ? Theme.ButtonStyles.fill : null,
|
||||
@@ -59,10 +60,10 @@ export const Button: React.FC<ButtonProps> = (props) => {
|
||||
icon={props.icon}
|
||||
onPress={handleOnPress}
|
||||
loading={props.loading}
|
||||
{...testID(props.testID)}
|
||||
/>
|
||||
) : (
|
||||
<RNEButton
|
||||
{...testIDProps(props.testID)}
|
||||
buttonStyle={buttonStyle}
|
||||
ViewComponent={require('react-native-linear-gradient').default}
|
||||
linearGradientProps={{
|
||||
@@ -88,7 +89,6 @@ export const Button: React.FC<ButtonProps> = (props) => {
|
||||
icon={props.icon}
|
||||
onPress={handleOnPress}
|
||||
loading={props.loading}
|
||||
{...testID(props.testID)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
SafeAreaView,
|
||||
} from 'react-native';
|
||||
import { Theme, ElevationLevel, Spacing } from './styleUtils';
|
||||
import testID from '../../shared/commonUtil';
|
||||
import testIDProps from '../../shared/commonUtil';
|
||||
|
||||
function createLayout(
|
||||
direction: FlexStyle['flexDirection'],
|
||||
@@ -49,13 +49,13 @@ function createLayout(
|
||||
|
||||
return props.scroll ? (
|
||||
<ScrollView
|
||||
{...testIDProps(props.testID)}
|
||||
contentContainerStyle={styles}
|
||||
refreshControl={props.refreshControl}
|
||||
{...testID(props.testID)}>
|
||||
refreshControl={props.refreshControl}>
|
||||
{props.children}
|
||||
</ScrollView>
|
||||
) : (
|
||||
<ViewType style={styles} {...testID(props.testID)}>
|
||||
<ViewType {...testIDProps(props.testID)} style={styles}>
|
||||
{props.children}
|
||||
</ViewType>
|
||||
);
|
||||
|
||||
@@ -1,7 +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';
|
||||
import testIDProps from '../../shared/commonUtil';
|
||||
|
||||
export const Text: React.FC<TextProps> = (props: TextProps) => {
|
||||
const weight = props.weight || 'regular';
|
||||
@@ -18,9 +18,9 @@ export const Text: React.FC<TextProps> = (props: TextProps) => {
|
||||
|
||||
return (
|
||||
<RNText
|
||||
{...testIDProps(props.testID)}
|
||||
style={textStyles}
|
||||
numberOfLines={props.numLines}
|
||||
{...testID(props.testID)}>
|
||||
numberOfLines={props.numLines}>
|
||||
{props.children}
|
||||
</RNText>
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@ import { TouchableOpacity } from 'react-native';
|
||||
import { individualId } from '../../../shared/constants';
|
||||
import { GET_INDIVIDUAL_ID } from '../../../shared/constants';
|
||||
import { MessageOverlay } from '../../../components/MessageOverlay';
|
||||
import testID from '../../../shared/commonUtil';
|
||||
import testIDProps from '../../../shared/commonUtil';
|
||||
|
||||
export const IdInputModal: React.FC<IdInputModalProps> = (props) => {
|
||||
const { t } = useTranslation('IdInputModal');
|
||||
@@ -77,7 +77,7 @@ export const IdInputModal: React.FC<IdInputModalProps> = (props) => {
|
||||
</Column>
|
||||
<Column fill>
|
||||
<Input
|
||||
{...testID('inputId')}
|
||||
{...testIDProps('idInput')}
|
||||
inputContainerStyle={
|
||||
controller.id ? Theme.Styles.VidInputBottom : null
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Column, Text } from '../../../components/ui';
|
||||
import { ModalProps, Modal } from '../../../components/ui/Modal';
|
||||
import { Theme } from '../../../components/ui/styleUtils';
|
||||
import { Image, TouchableOpacity } from 'react-native';
|
||||
import testID from '../../../shared/commonUtil';
|
||||
|
||||
export const OtpVerificationModal: React.FC<OtpVerificationModalProps> = (
|
||||
props
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
MessageOverlay,
|
||||
} from '../../components/MessageOverlay';
|
||||
import { Icon } from 'react-native-elements';
|
||||
import testID from '../../shared/commonUtil';
|
||||
|
||||
export const MyVcsTab: React.FC<HomeScreenTabProps> = (props) => {
|
||||
const { t } = useTranslation('MyVcsTab');
|
||||
|
||||
@@ -18,7 +18,7 @@ export interface Argon2iConfig {
|
||||
mode: string;
|
||||
}
|
||||
|
||||
export default function testID(id) {
|
||||
export default function testIDProps(id) {
|
||||
return Platform.OS === 'android'
|
||||
? { accessible: true, accessibilityLabel: id }
|
||||
: { testID: id };
|
||||
|
||||
Reference in New Issue
Block a user