Commit e40d2145 by Torkel Ödegaard

fixing input unit test failure

parent 42ee81a9
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import classNames from 'classnames';
import { ValidationEvents, ValidationRule } from 'app/types'; import { ValidationEvents, ValidationRule } from 'app/types';
import { validate, hasValidationEvent } from 'app/core/utils/validate'; import { validate, hasValidationEvent } from 'app/core/utils/validate';
...@@ -80,7 +81,7 @@ export class Input extends PureComponent<Props> { ...@@ -80,7 +81,7 @@ export class Input extends PureComponent<Props> {
render() { render() {
const { validationEvents, className, hideErrorMessage, ...restProps } = this.props; const { validationEvents, className, hideErrorMessage, ...restProps } = this.props;
const { error } = this.state; const { error } = this.state;
const inputClassName = 'gf-form-input' + (this.isInvalid ? ' invalid' : '') + ' ' + className; const inputClassName = classNames('gf-form-input', { invalid: this.isInvalid }, className);
const inputElementProps = this.populateEventPropsWithStatus(restProps, validationEvents); const inputElementProps = this.populateEventPropsWithStatus(restProps, validationEvents);
return ( return (
......
...@@ -36,25 +36,25 @@ export default class UnitPicker extends PureComponent<Props> { ...@@ -36,25 +36,25 @@ export default class UnitPicker extends PureComponent<Props> {
}; };
}); });
const styles = { // const styles = {
...ResetStyles, // ...ResetStyles,
menu: () => ({ // menu: () => ({
maxHeight: '75%', // maxHeight: '75%',
overflow: 'scroll', // overflow: 'scroll',
}), // }),
menuList: () => // menuList: () =>
({ // ({
overflowY: 'auto', // overflowY: 'auto',
position: 'relative', // position: 'relative',
} as React.CSSProperties), // } as React.CSSProperties),
valueContainer: () => // valueContainer: () =>
({ // ({
overflow: 'hidden', // overflow: 'hidden',
textOverflow: 'ellipsis', // textOverflow: 'ellipsis',
maxWidth: '90px', // maxWidth: '90px',
whiteSpace: 'nowrap', // whiteSpace: 'nowrap',
} as React.CSSProperties), // } as React.CSSProperties),
}; // };
const value = groupOptions.map(group => { const value = groupOptions.map(group => {
return group.options.find(option => option.value === defaultValue); return group.options.find(option => option.value === defaultValue);
...@@ -74,7 +74,7 @@ export default class UnitPicker extends PureComponent<Props> { ...@@ -74,7 +74,7 @@ export default class UnitPicker extends PureComponent<Props> {
Group: UnitGroup, Group: UnitGroup,
Option: UnitOption, Option: UnitOption,
}} }}
styles={styles} styles={ResetStyles}
/> />
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment