Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fixed] Allow ReactDOM.createPortal to be mocked in tests #701

Merged
merged 4 commits into from
Oct 27, 2018

Conversation

devrelm
Copy link
Contributor

@devrelm devrelm commented Oct 15, 2018

Fixes #553

See the related comment.

Changes proposed:

  • Move createPortal method-resolution inside a method so that it can be determined at the time that it is needed. This allows developers to mock out ReactDOM.createPortal inside tests, which can be needed for various reasons including react-test-renderer not supporting portals.

Upgrade Path (for changed or removed APIs):

N/A

Acceptance Checklist:

  • The commit message follows the guidelines in CONTRIBUTING.md.
  • Documentation (README.md) and examples have been updated as needed.
  • If this is a code change, a spec testing the functionality has been added.
  • If the commit message has [changed] or [removed], there is an upgrade path above.

@diasbruno
Copy link
Collaborator

Hi @devrelm, I'll have a look on all PRs this weekend. Thanks!

@diasbruno diasbruno merged commit fc53400 into reactjs:master Oct 27, 2018
@diasbruno
Copy link
Collaborator

Thanks, @devrelm. Good job!

@devrelm devrelm deleted the devrelm/createPortal-scoping branch October 29, 2018 21:04
programmer4web pushed a commit to programmer4web/react-modal that referenced this pull request Oct 5, 2020
Fixes reactjs#553 - PR  reactjs#701

* Allow ReactDOM.createPortal to be mocked in tests (9cd0891)
* add testability tests (6a67946)
* linting (f29e7b0)
* more linting (5992f97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants