reactjsenzymeava

Is it possible to test that a css style property exists for a React component using enzyme + ava?


I'm looking to test that a component has an opacity value of 0 after firing an event, I have not found how to get/check for a specific css property with enzyme (enzyme docs), is it even possible to do it just with enzyme & ava? Or is a third party library needed? At most I get the component props or the class name but I have no access to the style.

OBS: I don't want to use Jest instead of Ava, any other supporting library to work alongside with ava is welcome. For the record, the answers in this question: How to test style for a React component attribute with Enzyme Don't seem to work unless you use Jest.

Versions:


Solution

  • Can't be done if it it not inline style (just with enzyme + ava), it's better to go for e2e tests for UI css checks.