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

describe('BooleanSelectGroup', () => {
  it('renders without crashing', () => {
    render(
      <FormTestBase>
        {({ Field }) => (
          <Field
            name="allowLogin"
            Component={BooleanSelectGroup}
            label="Allow Login"
          />
        )}
      </FormTestBase>
    );
  });

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