V2Wizard: Add datatest-id support to <ValidatedTextInput>
Adds a `dataTestId` prop to the `<ValidatedTextInput>`.
This commit is contained in:
parent
698037a7dc
commit
ce23667833
2 changed files with 4 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
} from '@patternfly/react-core';
|
||||
|
||||
interface ValidatedTextInputPropTypes extends TextInputProps {
|
||||
dataTestId?: string | undefined;
|
||||
ariaLabel: string | undefined;
|
||||
helperText: string | undefined;
|
||||
validator: (value: string | undefined) => Boolean;
|
||||
|
|
@ -15,6 +16,7 @@ interface ValidatedTextInputPropTypes extends TextInputProps {
|
|||
}
|
||||
|
||||
export const ValidatedTextInput = ({
|
||||
dataTestId,
|
||||
ariaLabel,
|
||||
helperText,
|
||||
validator,
|
||||
|
|
@ -39,6 +41,7 @@ export const ValidatedTextInput = ({
|
|||
<>
|
||||
<TextInput
|
||||
value={value}
|
||||
data-testid={dataTestId}
|
||||
type="text"
|
||||
onChange={onChange}
|
||||
validated={handleValidation()}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ const Gcp = () => {
|
|||
>
|
||||
<ValidatedTextInput
|
||||
ariaLabel="google principal"
|
||||
data-testid="principal"
|
||||
dataTestId="principal"
|
||||
value={gcpEmail || ''}
|
||||
validator={isGcpEmailValid}
|
||||
onChange={(_event, value) => dispatch(changeGcpEmail(value))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue