mardi 18 décembre 2018

How to create a fake context for redux-form (useful for enzyme shallow rendering tests)?

What is the correct way to create a context and any necessary data for shallow rendering components wrapped by redux-form?

Here's a couple of examples:

https://github.com/styled-components/jest-styled-components#theming https://github.com/yahoo/react-intl/wiki/Testing-with-React-Intl#enzyme

Ideally, it should be easy to use with the shallowUntilTarget approach:

https://github.com/mozilla/addons-frontend/blob/58d1315409f1ad6dc9b979440794df44c1128455/tests/unit/helpers.js#L276 https://hacks.mozilla.org/2018/04/testing-strategies-for-react-and-redux/

Aucun commentaire:

Enregistrer un commentaire