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

bugfix: fix error in hasClass when className is regex expression #2057

Merged
merged 3 commits into from Mar 19, 2019

Conversation

alvteren
Copy link
Contributor

When className is regexp raises the issue in packages/enzyme/src/ShallowWrapper.js on the line 1256

 TypeError: className.indexOf is not a function

@alvteren alvteren changed the title Fix error in hasClass when className is regexp bugfix: fix error in hasClass when className is regexp Mar 18, 2019
@alvteren alvteren changed the title bugfix: fix error in hasClass when className is regexp bugfix: fix error in hasClass when className is regex expression Mar 18, 2019
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.

(-‸ლ) whoops

  • i first made the existing tests consistent across shallow and mount
  • since there are already hasClass tests for both shallow and mount, i moved your new tests up to that section
  • i added the same tests and fix for mount

Thanks!

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