text: /**
   * Test the HomePage
   */
  
  import React from 'react';
  import { mount } from 'enzyme';
  import { IntlProvider } from 'react-intl';
  
  import { HomePage, mapDispatchToProps } from '../index';
  import { changeUsername } from '../actions';
  import { loadRepos } from '../../App/actions';
  
  describe('<HomePage />', () => {
    it('should render the repos list', () => {
      /* const renderedComponent = shallow(
        <HomePage loading error={false} repos={[]} />
      );
      expect(renderedComponent.contains(<ReposList loading error={false} repos={[]} />)).toEqual(true);*/
    });
  
    it('should render fetch the repos on mount if a username exists', () => {
      const submitSpy = jest.fn();
      mount(
        <IntlProvider locale="en">
          <HomePage
            username="Not Empty"
            onChangeUsername={() => {}}
            onSubmitForm={submitSpy}
          />
        </IntlProvider>
      );
      expect(submitSpy).toHaveBeenCalled();
    });
  
    describe('mapDispatchToProps', () => {
      describe('onChangeUsername', () => {
        it('should be injected', () => {
          const dispatch = jest.fn();
          const result = mapDispatchToProps(dispatch);
          expect(result.onChangeUsername).toBeDefined();
        });
  
        it('should dispatch changeUsername when called', () => {
          const dispatch = jest.fn();
          const result = mapDispatchToProps(dispatch);
          const username = 'mxstbr';
          result.onChangeUsername({ target: { value: username } });
          expect(dispatch).toHaveBeenCalledWith(changeUsername(username));
        });
      });
    });
  
    describe('onSubmitForm', () => {
      it('should be injected', () => {
        const dispatch = jest.fn();
        const result = mapDispatchToProps(dispatch);
        expect(result.onSubmitForm).toBeDefined();
      });
  
      it('should dispatch loadRepos when called', () => {
        const dispatch = jest.fn();
        const result = mapDispatchToProps(dispatch);
        result.onSubmitForm();
        expect(dispatch).toHaveBeenCalledWith(loadRepos());
      });
  
      it('should preventDefault if called with event', () => {
        const preventDefault = jest.fn();
        const result = mapDispatchToProps(() => {});
        const evt = { preventDefault };
        result.onSubmitForm(evt);
        expect(preventDefault).toHaveBeenCalledWith();
      });
    });
  });
  