-
Notifications
You must be signed in to change notification settings - Fork 24
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
Placeholder classnames doesn't seem to work #24
Comments
Hi @jameswlane, |
@kentcdodds, |
@kentcdodds, figured out the issue that was effecting the placeholder classnames. Style that effected filter:
Style that worked:
The missing space before the It would work fine in the browser but when the filter did the comparison it would fail. return rule.selectors.some(selector => {
const baseSelector = selector.split(/:| |\./).filter(s => !!s)[0]
return nodeSelectors.some(
// sel: .css-yap912 === css-yap912> returns FALSE
// sel: .css-yap912 === .css-yap912> returns FALSE
sel => sel === baseSelector || sel === `.${baseSelector}`,
)
}) |
Awesome! Thanks for finding that! Do you think you could make a pull request to fix it (including tests)? |
I can look at it this weekend. First I want to test it with a number of multiple selectors:
See how glamor will handle them and what ones could cause a failure. |
Sounds super! Anything you can do to improve things in this regard would be fantastic 👍 |
I am thinking something as simple as this should get everything.
|
Ran into a few issues this weekend, I could use a second set of eyes. Here is what I found out: Pseudo-classes and Pseudo-elements do not effect this bug, so we can not worry about them.
As for the child selector:
I added the following to test here, but my regex seems to not be very strong this weekend. I have yet to find a regex that will match and allow me to select everything before the selector.
Last one that's throwing me off:
I added the following to test here and its throwing a
|
Why don't you go ahead and open a pull request with what you have and we'll see what we can do about it :) |
glamor
version: 2.20.40jest-glamor-react
version: 3.2.1node
version: 8.9.1yarn
version: 1.3.2What happened:
When running snapshot testing the classnames are not being replaced with placeholder classnames.
Reproduction repository:
https://github.com/jameswlane/jest-glamor-react-issue
Problem description:
My snapshots are using glamor classnames
The text was updated successfully, but these errors were encountered: