import React from 'react';
import ReactDOM from 'react-dom';
import Lifecycle from './Lifecycle.js';


it('renders without crashing', () => {
  const div = document.createElement('div');
  ReactDOM.render(<Lifecycle><div>hello</div></Lifecycle>, div);
});


it('calls componentWillMount', () => {
  const div = document.createElement('div');
  const props = {
    componentWillMount: jest.fn()
  };
  ReactDOM.render(<Lifecycle {...props}><div>hello</div></Lifecycle>, div);
  expect(props.componentWillMount).toHaveBeenCalled();
});

@@ -523,12 +523,396 @@
 lled();%0A%7D);%0A
+%0Ait('calls componentWillUnmount', () =%3E %7B%0A  const div = document.createElement('div');%0A  const props = %7B%0A    componentWillUnmount: jest.fn()%0A  %7D;%0A  ReactDOM.render(%3CLifecycle %7B...props%7D%3E%3Cdiv%3Ehello%3C/div%3E%3C/Lifecycle%3E, div);%0A  expect(props.componentWillUnmount).not.toHaveBeenCalled();%0A  ReactDOM.render(%3Cb%3Egoodbye%3C/b%3E, div);%0A  expect(props.componentWillUnmount).toHaveBeenCalled();%0A%7D);%0A

Add another Lifecycle test case