import React from 'react';
import { mount, shallow } from 'enzyme';
import sinon from 'sinon';

import App from './../App';
import Actions from './../Actions';

jest.mock('./../components/Home', () => {
  return props => {
    return <div />;
  };
});

describe('<App />', () => {
  it('always renders a div', () => {
    const wrapper = shallow(<App />);
    expect(wrapper.find('div').length).toBeGreaterThan(0);
  });

  it('should call componentDidMount once and getCurrentLocation Action', () => {
    sinon.spy(App.prototype, 'componentDidMount');
    sinon.spy(Actions, 'getCurrentLocation');

    const wrapper = mount(<App />);

    expect(App.prototype.componentDidMount.calledOnce).toEqual(true);
    expect(Actions.getCurrentLocation.calledOnce).toEqual(true);
  });
});

@@ -20,16 +20,45 @@
 react';%0A
+import Reflux from 'reflux';%0A
 import %7B
@@ -800,13 +800,441 @@
 );%0A  %7D);
+%0A%0A  it('should call componentWillUnmount once and Reflux componentWillUnmount method', () =%3E %7B%0A    sinon.spy(App.prototype, 'componentWillUnmount');%0A    sinon.spy(Reflux.Component.prototype, 'componentWillUnmount');%0A%0A    const wrapper = mount(%3CApp /%3E).unmount();%0A%0A    expect(App.prototype.componentWillUnmount.calledOnce).toEqual(true);%0A    expect(Reflux.Component.prototype.componentWillUnmount.calledOnce).toEqual(true);%0A  %7D);
 %0A%7D);%0A

Complete coverage on App.js