react-modal
react-modal copied to clipboard
onAfterOpen is not called in jest tests
Summary:
During unit testing in Jest/Enzyme onAfterOpen callback is not called; after-open classes are not added to the test snapshots. They seem to work as expected in the UI.
Steps to reproduce:
See test in example code: https://codesandbox.io/s/pedantic-brattain-v2mw8?file=/src/App.spec.js
Expected behavior:
Modal fully opens in test environment as well as in the browser
Link to example of issue:
https://codesandbox.io/s/pedantic-brattain-v2mw8?file=/src/App.spec.js
Additional notes:
This behaviour has started after upgrading to version 3.14. Our tests stated to fail then, with snapshots missing after-open-class-name, and not calling the callback functions. Could not find anything related in the change-logs.
https://github.com/reactjs/react-modal/pull/887/files :/