-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted
EuiFormErrorText
to TS (#1772)
* [Pagination] - Updated Changelog * Code Review - Moved Changelog entry to current master * [META] - Converted to TS + tests * Code review fixes * [META] - Converted to TS * Updated Changelog * EuiFormErrorText - Code review fixes
- Loading branch information
1 parent
87feadb
commit e99ffaa
Showing
7 changed files
with
21 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
9 changes: 3 additions & 6 deletions
9
...m/form_error_text/form_error_text.test.js → .../form_error_text/form_error_text.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
import React from 'react'; | ||
import { render } from 'enzyme'; | ||
import { requiredProps } from '../../../test/required_props'; | ||
import { requiredProps } from '../../../test'; | ||
|
||
import { EuiFormErrorText } from './form_error_text'; | ||
|
||
describe('EuiFormErrorText', () => { | ||
test('is rendered', () => { | ||
const component = render( | ||
<EuiFormErrorText {...requiredProps}> | ||
This is an error. | ||
</EuiFormErrorText> | ||
<EuiFormErrorText {...requiredProps}>This is an error.</EuiFormErrorText> | ||
); | ||
|
||
expect(component) | ||
.toMatchSnapshot(); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, { FunctionComponent, HTMLAttributes } from 'react'; | ||
|
||
import classNames from 'classnames'; | ||
import { CommonProps } from '../../common'; | ||
|
||
export const EuiFormErrorText: FunctionComponent< | ||
CommonProps & HTMLAttributes<HTMLDivElement> | ||
> = ({ children, className, ...rest }) => { | ||
const classes = classNames('euiFormErrorText', className); | ||
|
||
return ( | ||
<div className={classes} aria-live="polite" {...rest}> | ||
{children} | ||
</div> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { EuiFormErrorText } from './form_error_text'; |