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 hasClassName in case className is not a string and has toString method. #519

Merged
merged 2 commits into from
Aug 2, 2016

Conversation

f0rmat1k
Copy link
Contributor

@f0rmat1k f0rmat1k commented Jul 28, 2016

Closes #518

@@ -27,6 +27,7 @@ export function childrenOfNode(node) {

export function hasClassName(node, className) {
let classes = propsOfNode(node).className || '';
classes = String(classes);
classes = classes.replace(/\s/g, ' ');
Copy link
Member

Choose a reason for hiding this comment

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

String(classes).replace would be a bit more succinct, fwiw.

@f0rmat1k f0rmat1k force-pushed the hasClassName-toString branch from c96eee7 to 2fa3716 Compare July 28, 2016 18:02
@f0rmat1k
Copy link
Contributor Author

@ljharb agreed. fixed.

@ljharb
Copy link
Member

ljharb commented Jul 28, 2016

LGTM

@blainekasten
Copy link
Contributor

This branch needs to be caught up now.

@f0rmat1k
Copy link
Contributor Author

f0rmat1k commented Aug 2, 2016

@blainekasten using merge is ok?

@aweary aweary merged commit a9bd325 into enzymejs:master Aug 2, 2016
@aweary
Copy link
Collaborator

aweary commented Aug 2, 2016

@f0rmat1k looks good, thanks for the PR!

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.

4 participants