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

describe('MoneyInputGroup', () => {
  it('renders without crashing', () => {
    render(
      <FormTestBase>
        {({ Field }) => (
          <Field
            name="yearlySalaryUSD"
            Component={MoneyInputGroup}
            label="Salary"
            className="something-here"
          />
        )}
      </FormTestBase>
    );
  });

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