jeudi 4 mai 2017

How to test next React Components with Enzyme

Given an app like:

<TestEnvSetup>
    <App />   
</TestEnvSetup>

and app.js

<UserForm>
   <DatePicker />
   <AutocompleteField />
   <MoreFields />
</UserForm>

I know I need to mount(<TestEnvSetup><App /></TestEnvSetup>), but how would I go about traversing components to compare state, interactions ect? For example make sure that the AutocompleteField signaled some flag on the App's state. Or am I thinking about this wrong?

Aucun commentaire:

Enregistrer un commentaire