Posts

Showing posts from April 2, 2019

How to test components wrapped in an antd Form?

Image
0 I've been struggling with this for months, now. Although there's a lot of speculation on the correct way to test antd wrapped components, none of the suggestions worked for this particular component. So, I have a component which is a modal with an antd form. In this form, I have a few fields: an input, a select and a tree select, nothing too fancy. It's basically this: class FormModal extends React.Component { static propTypes = { data: propTypes.object, form: propTypes.object, scopes: propTypes.array.isRequired, clients: propTypes.array.isRequired, treeData: propTypes.array.isRequired, isEditing: propTypes.bool.isRequired, isSaving: propTypes.bool.isRequired, onCancel: propTypes.func.isRequired, onSave: propTypes.func.isRequired, onFilterTree