import { create } from 'react-test-renderer';
import Tag from './Tag';
import TextArea from './TextArea';
describe('TextArea', () => {
it('Renders an FormErrorMessage if an error message is passed in', () => {
const component = create(
,
);
expect(JSON.stringify(component.toJSON())).toContain('Error message');
});
it('Does not render an FormErrorMessage when errorMessage is null', () => {
const component = create();
expect(JSON.stringify(component.toJSON())).not.toContain('Error message');
});
it('TextArea normal', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
it('TextArea with error', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
it('TextArea with hasError', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
it('TextField with maxLength character counter', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
it('TextArea with readOnly', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
it('TextArea with disabled', () => {
const tree = create(
,
).toJSON();
expect(tree).toMatchSnapshot();
});
it('TextArea with rows', () => {
const tree = create().toJSON();
expect(tree).toMatchSnapshot();
});
it('renders tags when supplied', () => {
const tree = create(