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

linear-gradient in background is parsed as invalid #148

Open
magom001 opened this issue Jan 24, 2022 · 2 comments
Open

linear-gradient in background is parsed as invalid #148

magom001 opened this issue Jan 24, 2022 · 2 comments

Comments

@magom001
Copy link

magom001 commented Jan 24, 2022

I noticed that when I try to do snapshot testing on my react components with inline styles, background: linear-gradient(...) is missing from the snapshot.

I described the issue in details on stackoverflow: https://stackoverflow.com/questions/70832768/jest-tomatchsnapshot-removes-inline-styles

I then tracked the issue to this:

In shorthandSetter the shorthandParser returns undefined because parseColor does know how to handle linear-gradient.

@magom001
Copy link
Author

Changing this from return undefined to return val fixes the issue.

@subrato-pattanaik
Copy link

Nice find! It seems jsdom doesn't handle the logic for any gradient function (linear-gradient, radial-gradient, conic-gradient, and its repeating variant).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants