I have a components library and I have a Tooltip
component that renders tooltip div at the very bottom of the document's body. How can I render the Tooltip
component in a fake DOM and then test if the div element has appeared after I hovered Tooltip
component?
So:
- first I have to render/mount a Tooltip component first.
- Simulate an event fe
wrapper.find('span').simulate('mouseenter')
- Check if the
<div>
element has appeared in a right place(as last body child).
I'm stuck on point 1 and 3. How can I test it in Jest/enzyme? Should I use JSDom?
Aucun commentaire:
Enregistrer un commentaire