Fix simulate being a no-op for memo components#2100
Merged
ljharb merged 1 commit intoenzymejs:masterfrom Apr 23, 2019
Merged
Conversation
…l the adapter’s implementation, not the raw one
ljharb
approved these changes
Apr 23, 2019
Member
ljharb
left a comment
There was a problem hiding this comment.
Thanks! This change will need to be made in all the react 16 adapters; also, instead of the arrow function, this should use the adapter reference that's already available (i've made that tweak).
I've confirmed that the new test fails without the fix. This seems to be something I broke here: 8221765
Contributor
Author
|
@ljharb That's even better, thanks. |
ljharb
added a commit
that referenced
this pull request
May 7, 2019
- [fix] `simulateEvent`: call the adapter’s implementation, not the raw one (#2100) - [deps] update `enzyme-adapter-utils` - [dev deps] update `eslint-plugin-react`, `eslint-plugin-import`
ljharb
added a commit
that referenced
this pull request
May 8, 2019
- [fix] `simulateEvent`: call the adapter’s implementation, not the raw one (#2100) - [deps] update `enzyme-adapter-utils` - [dev deps] update `eslint-plugin-react`, `eslint-plugin-import`
ljharb
added a commit
that referenced
this pull request
May 12, 2019
- [new] support `suspenseFallback` option; support `Suspense`/`Lazy` (#1975) - [fix] `shallow`: properly dive through `memo` components (#2103, #2068) - [fix] avoid a Context.Provider deprecation warning - [fix] shallow renderer for `memo` does not respect `defaultProps` (#2115) - [fix] Don’t show wrapped component displayName in lazy component (#1975) - [fix] `simulateEvent`: call the adapter’s implementation, not the raw one (#2100) - [deps] update `enzyme-adapter-utils` - [dev deps] update `eslint-plugin-react`, `eslint-plugin-import`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
mount(<MemoizedButton />).simulate('click')not calling theonClickhandler.I strongly suspect this fixes issues with
simulatenot necessarily related toReact.memoas well.Alternate implementation without arrow functions and outer
this: 9ef0776