Skip to content

Commit

Permalink
fix(Modal): use togglePortal on componentDidMount (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddywashere committed Aug 19, 2016
1 parent a358233 commit 942b24a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Modal extends React.Component {

componentDidMount() {
if (this.props.isOpen) {
this.show();
this.togglePortal();
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/Modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('Modal', () => {

jasmine.clock().tick(300);
expect(isOpen).toBe(true);
expect(Modal.prototype.togglePortal.calls.count()).toEqual(0);
expect(Modal.prototype.togglePortal.calls.count()).toEqual(1);
expect(Modal.prototype.renderIntoSubtree.calls.count()).toEqual(1);

wrapper.setProps({
Expand All @@ -192,7 +192,7 @@ describe('Modal', () => {
jasmine.clock().tick(300);

expect(isOpen).toBe(true);
expect(Modal.prototype.togglePortal.calls.count()).toEqual(0);
expect(Modal.prototype.togglePortal.calls.count()).toEqual(1);
expect(Modal.prototype.renderIntoSubtree.calls.count()).toEqual(2);

wrapper.unmount();
Expand Down

0 comments on commit 942b24a

Please sign in to comment.