Skip to content
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

Merged
merged 4 commits into from
Dec 14, 2017
Merged

Conversation

chrisronline
Copy link
Contributor

Relates to #177

Adds tests for:

  • FormHelpText
  • FormErrorText
  • FormControlLayout

@chrisronline chrisronline self-assigned this Dec 14, 2017
Copy link
Contributor

@cjcenizal cjcenizal left a 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,
Copy link
Contributor

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' }));
Copy link
Contributor

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/>
Copy link
Contributor

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.

Copy link
Contributor Author

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/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

@cjcenizal cjcenizal mentioned this pull request Dec 14, 2017
22 tasks
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@chrisronline chrisronline merged commit ab1ed5d into elastic:master Dec 14, 2017
@chrisronline chrisronline deleted the form-tests-p2 branch December 14, 2017 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants