Skip to content

Commit

Permalink
Merge pull request #787 from Autofleet/test-id
Browse files Browse the repository at this point in the history
testid
  • Loading branch information
EliFrankel authored Oct 15, 2023
2 parents 06c107f + 041c456 commit eea82ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/client/Locomotion/src/Components/BsPages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ const BsPage = ({
buttonDisabled,
warning,
fullWidthButtons,
subtitleTestId,
}: {
onSecondaryButtonPress?: any,
onButtonPress: any,
Expand All @@ -202,6 +203,7 @@ const BsPage = ({
buttonDisabled?: boolean;
warning?: boolean
fullWidthButtons?: boolean;
subtitleTestId: string
}) => {
const buttonWidth = fullWidthButtons ? '100%' : '48%';
return (
Expand All @@ -215,7 +217,7 @@ const BsPage = ({
{titleIcon && <SvgIcon Svg={titleIcon} style={{ marginRight: 5 }} />}
<Title>{TitleText}</Title>
</TitleContainer>
<SubTitle>{SubTitleText}</SubTitle>
<SubTitle testID={subtitleTestId}>{SubTitleText}</SubTitle>
</CardText>
{Image ? (
<ImageContainer>
Expand Down Expand Up @@ -380,6 +382,7 @@ export const GenericError = (props: any) => {
const { genericErrorDetails } = useContext(BottomSheetContext);
return (
<BsPage
subtitleTestId={genericErrorDetails.subtitleTestId}
TitleText={genericErrorDetails.titleText}
ButtonText={genericErrorDetails.buttonText}
SubTitleText={genericErrorDetails.subTitleText}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ const RidePageContextProvider = ({ children }: {
// mocks for now
[RIDE_FAILED_REASONS.USER_HAS_OUTSTANDING_BALANCE]: () => {
setGenericErrorDetails({
subtitleTestId: 'outstandingBalanceError',
titleText: i18n.t('bottomSheetContent.outstandingBalance.titleText'),
buttonText: i18n.t('bottomSheetContent.outstandingBalance.buttonText'),
subTitleText: i18n.t('bottomSheetContent.outstandingBalance.subTitleText'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const TopMessage = ({
text
? (
<SafeView>
<Container>
<Container testID={title}>
{title && (
<Title>
{icon && <SvgIcon Svg={icon} height={20} width={20} style={{ marginRight: 10 }} />}
Expand Down

0 comments on commit eea82ea

Please sign in to comment.