Skip to content

Conversation

@lelandrichardson
Copy link
Collaborator

to: @lencioni @ljharb @blainekasten

When users were passing in selectors with a non-quoted string such as [type=foo] it was causing undesired behavior, matching any component that had the type prop. This refactors the logic so that if the string is unquoted (and not an acceptable numeric literal or boolean), we throw a helpful error indicating that it should be quoted.

Fixes #127; Closes #129

src/Utils.js Outdated
Copy link
Member

Choose a reason for hiding this comment

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

this should probably be a TypeError

Copy link
Contributor

Choose a reason for hiding this comment

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

I also like what's going on this PR with prefacing these errors with Enzyme::Selector

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 i know, i know. my laziness is getting the best of me.

@lelandrichardson lelandrichardson force-pushed the lmr--fix-prop-selector-string-issue branch from 1840e29 to 0033fbf Compare January 20, 2016 20:35
@lencioni
Copy link
Contributor

👍

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.

5 participants