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

Update: Adds recursive check for isEmptyRender #1924

Merged
merged 3 commits into from
Dec 13, 2018

Conversation

sstern6
Copy link
Contributor

@sstern6 sstern6 commented Dec 4, 2018

Fixes #1866

 - [New] `utils`: add `recursiveEmptyRender` and `isEmptyValue`

Fixes enzymejs#1866.
packages/enzyme-test-suite/test/Utils-spec.jsx Outdated Show resolved Hide resolved
const renderedKey = 'rendered';

function dive(renderedNodes) {
const isList = renderedNodes && renderedNodes.length > 0 && Array.isArray(renderedNodes);
Copy link
Member

Choose a reason for hiding this comment

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

= Array.isArray(renderedNodes) && renderedNodes.length > 0?

packages/enzyme/src/Utils.js Outdated Show resolved Hide resolved
packages/enzyme/src/Utils.js Outdated Show resolved Hide resolved
return isEmptyRender;
}

dive(nodes);
Copy link
Member

Choose a reason for hiding this comment

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

could this not be return dive(nodes)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So initially I did have that. And then in my utils test cases, I was getting inconsistent return values. I will change back, bc this is something I prefer and research why.

@sstern6 sstern6 force-pushed the issue-1866 branch 2 times, most recently from 9d57bf4 to 169809e Compare December 13, 2018 05:34
packages/enzyme-test-suite/test/ReactWrapper-spec.jsx Outdated Show resolved Hide resolved
packages/enzyme-test-suite/test/ReactWrapper-spec.jsx Outdated Show resolved Hide resolved
packages/enzyme-test-suite/test/Utils-spec.jsx Outdated Show resolved Hide resolved
packages/enzyme/src/Utils.js Outdated Show resolved Hide resolved
packages/enzyme/src/Utils.js Outdated Show resolved Hide resolved
packages/enzyme/src/Utils.js Outdated Show resolved Hide resolved
@sstern6 sstern6 force-pushed the issue-1866 branch 3 times, most recently from 9e85957 to 7aea80b Compare December 13, 2018 06:11
@ljharb ljharb added semver: minor New stuff. and removed semver: patch labels Dec 13, 2018
@ljharb ljharb merged commit e308754 into enzymejs:master Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants