import { render } from '../../../utils/theme-render-wrapper';
import { TextField } from './index';
import mockTextField from './__mocks__/mockTextField';

describe('<TextField />', () => {
  it('should render successfully', () => {
    const { baseElement } = render(<TextField />);
    expect(baseElement).toBeTruthy();
  });

  it('should render with error text', () => {
    const { baseElement } = render(
      <TextField {...mockTextField} color="primary" error helperText="Error text" />
    );
    expect(baseElement).toBeTruthy();
  });

  it('should render with custom hint', () => {
    const { baseElement } = render(
      <TextField
        {...mockTextField}
        color="secondary"
        labelWithHintProps={{
          tooltipProps: {
            placement: 'right'
          },
          tooltipText: 'Tooltip text'
        }}
      />
    );
    expect(baseElement).toBeTruthy();
  });
});
