/* eslint-env jest */
import React from 'react';
import { mount } from 'enzyme';
import DatePicker from '../DatePicker';
import Years from '../Years';

const getSubject = props => {
  const mockFunctionalComponent = jest.fn(() => null);
  mount(
  /*#__PURE__*/
  // eslint-disable-next-line react/jsx-props-no-spreading
  React.createElement(DatePicker, props, /*#__PURE__*/React.createElement(Years, null, mockFunctionalComponent)));
  return mockFunctionalComponent;
};

describe('<Years>', () => {
  it('provides years from min to max', () => {
    const subject = getSubject({
      min: '1977-07-07',
      max: '1989-09-09'
    });
    expect(subject.mock.calls[0][0]).toMatchSnapshot();
  });
});