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

describe('FileGroup', () => {
  it('renders without crashing', () => {
    render(
      <FormTestBase>
        {({ Field }) => (
          <Field
            name="profileImage"
            Component={FileGroup}
            label="Profile Image"
          />
        )}
      </FormTestBase>
    );
  });

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