import React from 'react';
import { render } from '@testing-library/react';
import FormTestBase from '../../__Tests__/FormTestBase';
import StringInputGroup from '../StringInputGroup';

describe('StringInputGroup', () => {
  it('renders without crashing', () => {
    render(
      <FormTestBase>
        {({ Field }) => (
          <Field name="name" Component={StringInputGroup} label="Name" />
        )}
      </FormTestBase>
    );
  });

  it('has matching snapshot', () => {
    const renderResult = render(
      <FormTestBase>
        {({ Field }) => (
          <Field name="name" Component={StringInputGroup} label="Name" />
        )}
      </FormTestBase>
    );
    expect(renderResult.asFragment()).toMatchSnapshot();
  });
});
