enzymejs / enzymejs/enzyme

simulate() support for custom events on shallow rendered children

Open
#147 16 comments 11 reactions 0 assignees View on GitHub
API: shallow feature request
Dominant language
JavaScript
Stars
19.8k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

Any thoughts on having simulate run arbitrary custom events on a shallowly rendered child? Ie ideally I'd like to be able to call simulate on any of a shallow rendered childs props that call a function.

ex calling `simulate('customEvent')` on ` would run`func()` on a shallow rendered component.

This would allow us to assert functions that might not run on standard dom events without having to write a full integration test.

We could create a new function shallowSimulate() or something if we're worried about the interactions on fully `mount()`ed components.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.