trainline / react-skeletor

Skeleton loading for React
https://trainline.github.io/react-skeletor/
Other
554 stars 27 forks source link

Skeleton elements don't have displayName property #17

Closed antonydb closed 6 years ago

antonydb commented 6 years ago

Testing libraries, such as enzyme rely on the displayName property to be able successfully find a component after rendering see example documentation here.

Currently react-skeletor does not set this property making it difficult to use with testing libraries such as enzyme.

We can use a similar technique used by styled-components to set the displayName

@alex3165 I have tested this out and I'm happy to put this in a PR. I also work for Trainline :)