Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/Form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default class Form extends Component {
key={index}
ref={(c) => { this[input.get('name')] = c; }}
className='loginInput'
data-testid={input.get('data-testid')}
hidden={input.get('hidden')}
disabled={input.get('disabled')}
type={input.get('type')}
Expand Down
4 changes: 3 additions & 1 deletion components/FormInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class FormInput extends Component {
}

render() {
const { type, label, name, value, placeholder, disabled, className, error, tabIndex, hidden, acceptType } = this.props;
const { type, label, name, 'data-testid': dataTestId, value, placeholder, disabled, className, error, tabIndex, hidden, acceptType } = this.props;
const { onBlur, onChange } = this.props;
const inputClassName = className + (disabled ? ' disabled' : '') + (value ? ' hasValue' : '') + (error ? ' hasError' : '') + (hidden ? ' hidden' : '');

Expand All @@ -25,6 +25,7 @@ export default class FormInput extends Component {
disabled={disabled}
name={name}
type={type}
data-testid={dataTestId}
data-hidden={!!hidden}
placeholder={placeholder}
accept={acceptType}
Expand All @@ -49,6 +50,7 @@ FormInput.propTypes = {
value: PropTypes.string,
name: PropTypes.string,
label: PropTypes.string,
id: PropTypes.string,
disabled: PropTypes.bool,
hidden: PropTypes.bool,
placeholder: PropTypes.string,
Expand Down
3 changes: 2 additions & 1 deletion components/StandardButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const getClassInternal = (className) => {
const Button = ({
type,
label,
'data-testid': dataTestId,
icon,
onClick,
className,
Expand All @@ -36,7 +37,7 @@ const Button = ({
disabledClass = Array.isArray(disabledClassName) ? disabledClassName.map(getClassInternal) : getClassInternal(disabledClassName);
}
const button = (
<button disabled={disabled} type={type} className={classNames(cssClass, disabledClass)} onClick={onClick}>
<button data-testid ={dataTestId} disabled={disabled} type={type} className={classNames(cssClass, disabledClass)} onClick={onClick}>
{icon && <span className={icon} />}
<Text>{label}</Text>
</button>
Expand Down
2 changes: 2 additions & 0 deletions containers/LoginForm/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export const inputs = {
name: 'username',
type: 'text',
label: 'Username',
'data-testid': 'ut-login-username',
value: '',
error: '',
validateOrder: ['isRequired', 'minLength', 'maxLength'],
Expand All @@ -16,6 +17,7 @@ export const inputs = {
name: 'password',
type: 'password',
label: 'Password',
'data-testid': 'ut-login-password',
value: '',
error: '',
validateOrder: ['isRequired'],
Expand Down
2 changes: 1 addition & 1 deletion containers/LoginForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class LoginForm extends Component {
className='loginForm'
inputs={inputs}
title={{className: 'loginTitle' + (error ? ' error' : ''), text: title}}
buttons={[{label: buttonLabel, className: 'standardBtn loginBtn', type: 'submit'}]}
buttons={[{'data-testid': 'ut-login-submit-button', label: buttonLabel, className: 'standardBtn loginBtn', type: 'submit'}]}
onChange={this.onChange}
onSubmit={this.validateForm}
error={error}
Expand Down