Given a component which has some CSS animations (such as sliding in/out):
function MyComponent(props) {
return (
<div
className="with-animations"
onAnimationEnd={() => {
// set internal state
// logic which needs coverage
}}
>
{props.children}
</div>
);
}
How can I verify that the code within the onAnimationEnd event handler was invoked?
Is there a way to mock this out?