-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form tests - Phase 2 #207
Form tests - Phase 2 #207
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. I just had a couple questions.
iconSide: PropTypes.oneOf(ICON_SIDES), | ||
isLoading: PropTypes.bool, | ||
className: PropTypes.string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catches!
ICON_SIDES, | ||
} from './form_control_layout'; | ||
|
||
jest.mock('../../', () => ({ EuiIcon: 'eui_icon', EuiLoadingSpinner: 'eui_loading_spinner' })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm learning a lot from your use of mocks.
@@ -7,7 +7,9 @@ import { EuiFormErrorText } from './form_error_text'; | |||
describe('EuiFormErrorText', () => { | |||
test('is rendered', () => { | |||
const component = render( | |||
<EuiFormErrorText {...requiredProps} /> | |||
<EuiFormErrorText {...requiredProps}> | |||
<input/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of just using text here instead of a node? The node validates that the prop supports this type, but text is much more demonstrative of an actual use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
@@ -7,7 +7,9 @@ import { EuiFormHelpText } from './form_help_text'; | |||
describe('EuiFormHelpText', () => { | |||
test('is rendered', () => { | |||
const component = render( | |||
<EuiFormHelpText {...requiredProps} /> | |||
<EuiFormHelpText {...requiredProps}> | |||
<input/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
b66146e
to
0d9642c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Relates to #177
Adds tests for: