Assume i have a simple component I wish to snapshot test:
const Component = styled.div`{
color: red;
}`
My snapshot test wishes to ensure that the div renders, but the styling is not important. So if I did a snapshot test on this Component
, and i changed color
from red to blue, and a new classname is generated, it would not fail the snapshot test.
In short, is there any way I can either ignore className in snapshot tests, or tell styled-components to generate static class names to be deterministic in tests?