Currently I have two separate icons using the same component -
<Icon className={classes.icon} src={xxxx} title="happy"/>
<Icon className={classes.icon} src={yyyy} title="sad"/>
I want to use Enzyme to test how many happy icons there are. Wonder if you can look it up by its title, or do I have to add another class name?
I want something like
expect(wrapper.find(Icon).title === 'happy').toHaveLength(3)
But I am sure this is not right...