Skip to content

Commit

Permalink
Converted EuiFormErrorText to TS (#1772)
Browse files Browse the repository at this point in the history
* [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
theodesp authored and chandlerprall committed Apr 1, 2019
1 parent 87feadb commit e99ffaa
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

No public interface changes since `9.7.1`.
- Converted `EuiFormErrorText` to TS ([#1772](https://github.com/elastic/eui/pull/1772))

## [`9.7.1`](https://github.com/elastic/eui/tree/v9.7.1)

Expand Down
22 changes: 0 additions & 22 deletions src/components/form/form_error_text/form_error_text.js

This file was deleted.

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();
});
});
16 changes: 16 additions & 0 deletions src/components/form/form_error_text/form_error_text.tsx
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>
);
};
3 changes: 0 additions & 3 deletions src/components/form/form_error_text/index.js

This file was deleted.

1 change: 1 addition & 0 deletions src/components/form/form_error_text/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { EuiFormErrorText } from './form_error_text';

0 comments on commit e99ffaa

Please sign in to comment.