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

Remove isFunctionalComponent, use nodeType instead #1076

Merged
merged 2 commits into from
Aug 20, 2017

Conversation

aweary
Copy link
Collaborator

@aweary aweary commented Aug 17, 2017

@aweary aweary requested a review from ljharb August 17, 2017 18:57
@@ -346,7 +345,7 @@ class ShallowWrapper {
if (this.root !== this) {
throw new Error('ShallowWrapper::setState() can only be called on the root');
}
if (this.instance() === null || isFunctionalComponent(this.instance())) {
if (this.instance() === null || this.renderer.getNode().nodeType === 'function') {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have agetNodeInternal helper but it returns the rendered node, and here we need the actual root node.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit

@ljharb ljharb merged commit e7ec246 into enzymejs:master Aug 20, 2017
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.

3 participants