import configureStore from 'redux-mock-store';
import ResetPasswordModal from './resetPasswordModal';
import React from 'react';
import ReactTestRenderer from 'react-test-renderer';
import { MemoryRouter } from 'react-router-dom';
import { Provider } from 'react-redux';

jest.mock('app/common/store', () => ({
  history: { push: () => {} },
}));

describe('RestePasswordModal tests', () => {
  const initialState = {};
  const mockStore = configureStore();
  let store;

  beforeEach(() => {
    store = mockStore(initialState);
  });

  it('renders page correctly', () => {
    const tree = ReactTestRenderer
      .create(
        <Provider store={store}>
          <MemoryRouter>
            <ResetPasswordModal isOpened onOverlay={() => null}/>
          </MemoryRouter>
        </Provider>
      )
      .toJSON();
    expect(tree).toMatchSnapshot();
  });
});