enzymejs / enzyme

JavaScript Testing utilities for React
https://enzymejs.github.io/enzyme/
MIT License
19.96k stars 2.01k forks source link

setFieldsValue #2489

Open coderboyQ opened 3 years ago

coderboyQ commented 3 years ago

在进行单元测试时,xxx.jsx目标文件中右form表单(用的是antd中的FORM组件)的重置方法(setFieldsValue),一直获取为空 下面一图为我打印的this image 二图为报错打印 image

ljharb commented 3 years ago

I’d need more code than this - including your test code. Is this using shallow or mount?

Note that refs only work in mount.

ljharb commented 3 years ago

Also, please always fill out the issue template in its entirety - it’s there for a reason.