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

describe('PhoneNumberInputGroup', () => {
  it('renders without crashing', () => {
    render(
      <FormTestBase>
        {({ Field }) => (
          <Field
            name="phoneNumber"
            Component={PhoneNumberInputGroup}
            label="Phone Number"
            className="something-here"
          />
        )}
      </FormTestBase>
    );
  });

  it('has matching snapshot', () => {
    const renderResult = render(
      <FormTestBase>
        {({ Field }) => (
          <Field
            name="phoneNumber"
            Component={PhoneNumberInputGroup}
            label="Phone Number"
            className="something-here"
          />
        )}
      </FormTestBase>
    );
    expect(renderResult.asFragment()).toMatchSnapshot();
  });
});
