Follow-up from "feat: add loading icon"
The following discussion from !37 (merged) should be addressed:
-
@ClemMakesApps started a discussion: (+2 comments) I've intentionally added this new prop so that we can reliably test the image snapshot. The animation was making the snapshot test unreliable
Rather than making this a component prop, we could override the
.fa-spin
class within some test-specific css:.fa-spin { animation: none !important; }
(we do something similar to disable animations in RSpec)
Or we could rely on something like
if (process.env.NODE_ENV === 'test')
in the component to just omit thefa-spin
class within the target environment.The nice thing about one of these methods is that we could potentially still allow the generated storybook output to display the animations, but disable them when taking the image snapshots.