From 028ef3cc97cfc8c427d1b51515f55909e3dc210e Mon Sep 17 00:00:00 2001 From: Nickolay Khudkov Date: Thu, 16 Dec 2021 17:41:48 +0500 Subject: [PATCH] #15 --- index.d.ts | 1 + readme.md | 1 + src/components/field/index.js | 3 +++ src/components/helper/index.js | 5 +++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index d450cda5..7e470392 100644 --- a/index.d.ts +++ b/index.d.ts @@ -45,6 +45,7 @@ export interface TextFieldProps extends TextInputProps { error?: string; errorColor?: string; + errortTestId?: string; lineWidth?: number; activeLineWidth?: number; diff --git a/readme.md b/readme.md index 4083fb2f..347dc7eb 100644 --- a/readme.md +++ b/readme.md @@ -99,6 +99,7 @@ class Example extends Component { suffix | Text field suffix text | String | - error | Text field error text | String | - errorColor | Text field color for errored state | String | rgb(213, 0, 0) + errorTestId | Text field error testID | String | - lineType | Text field line type | String | solid disabledLineType | Text field line type in disabled state | String | dotted animationDuration | Text field animation duration in ms | Number | 225 diff --git a/src/components/field/index.js b/src/components/field/index.js index 0640a6c1..5a31f1f8 100644 --- a/src/components/field/index.js +++ b/src/components/field/index.js @@ -99,6 +99,7 @@ export default class TextField extends PureComponent { error: PropTypes.string, errorColor: PropTypes.string, + errorTestId: PropTypes.string, lineWidth: PropTypes.number, activeLineWidth: PropTypes.number, @@ -573,6 +574,7 @@ export default class TextField extends PureComponent { disabled, baseColor, errorColor, + errorTestId, titleTextStyle: style, characterRestriction: limit, } = this.props; @@ -601,6 +603,7 @@ export default class TextField extends PureComponent { ...styleProps, title, error, + testId: errorTestId, disabled, focusAnimation, }; diff --git a/src/components/helper/index.js b/src/components/helper/index.js index 76eb54d7..00dc0209 100644 --- a/src/components/helper/index.js +++ b/src/components/helper/index.js @@ -8,7 +8,7 @@ export default class Helper extends PureComponent { static propTypes = { title: PropTypes.string, error: PropTypes.string, - + testId: PropTypes.string, disabled: PropTypes.bool, style: Text.propTypes.style, @@ -70,6 +70,7 @@ export default class Helper extends PureComponent { disabled, baseColor, errorColor, + testId, } = this.props; let text = errored? @@ -89,7 +90,7 @@ export default class Helper extends PureComponent { }; return ( - + {text} );