Skip to content

Commit

Permalink
Merge 5017bbf into a09b298
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed Mar 10, 2019
2 parents a09b298 + 5017bbf commit 5a92878
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/browser/lifecycle.test.js
Expand Up @@ -921,7 +921,28 @@ describe('Lifecycle methods', () => {

render(<Foo />, scratch);
rerender();

expect(componentState).to.deep.equal({ value: 1 });

const cWRP = Foo.prototype.componentWillReceiveProps;
delete Foo.prototype.componentWillReceiveProps;

Foo.prototype.shouldComponentUpdate = cWRP;

render(null, scratch);
render(<Foo />, scratch);
rerender();

expect(componentState, 'via shouldComponentUpdate').to.deep.equal({ value: 1 });

delete Foo.prototype.shouldComponentUpdate;
Foo.prototype.componentWillUpdate = cWRP;

render(null, scratch);
render(<Foo />, scratch);
rerender();

expect(componentState, 'via componentWillUpdate').to.deep.equal({ value: 1 });
});

it('should NOT be called on initial render', () => {
Expand Down

0 comments on commit 5a92878

Please sign in to comment.