V2Wizard: Add datatest-id support to <ValidatedTextInput>

Adds a `dataTestId` prop to the `<ValidatedTextInput>`.
This commit is contained in:
lucasgarfield 2024-01-12 18:00:38 +01:00 committed by Klara Simickova
parent 698037a7dc
commit ce23667833
2 changed files with 4 additions and 1 deletions

View file

@ -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()}

View file

@ -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))}