text: import { useForm } from 'react-hook-form';
  import { mount } from 'enzyme';
  
  import PropTypes from 'prop-types';
  
  const MockForm = ({ FormElements, onSubmit }) => {
    const { handleSubmit, ...methods } = useForm();
  
    return (
      <form onSubmit={handleSubmit(onSubmit)}>
        {/* eslint-disable-next-line react/jsx-props-no-spreading */}
        <FormElements {...methods} />
      </form>
    );
  };
  
  MockForm.propTypes = {
    FormElements: PropTypes.func.isRequired,
    onSubmit: PropTypes.func.isRequired,
  };
  
  export default FormElements => {
    // eslint-disable-next-line no-undef
    const onSubmitMock = jest.fn();
  
    return [
      mount(<MockForm FormElements={FormElements} onSubmit={onSubmitMock} />),
      onSubmitMock,
    ];
  };
  