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.
Nice find! It seems jsdom doesn't handle the logic for any gradient function (linear-gradient, radial-gradient, conic-gradient, and its repeating variant).
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 handlelinear-gradient
.