],
},
});
expect(wrapper.render()).toMatchSnapshot();
});
it('should print warning for not generating help and validateStatus automatically', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
const Form1 = Form.create()(({ form }) => {
return (
{form.getFieldDecorator('account')()}
{form.getFieldDecorator('account')()}
);
});
mount();
expect(errorSpy).toHaveBeenCalledWith(
'Warning: [antd: Form.Item] Cannot generate `validateStatus` and `help` automatically, while there are more than one `getFieldDecorator` in it.',
);
errorSpy.mockRestore();
});
// https://github.com/ant-design/ant-design/issues/14911
it('should not print warning for not generating help and validateStatus automatically when help or validateStatus is specified', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
const Form1 = Form.create()(({ form }) => {
return (
{form.getFieldDecorator('account')()}
{form.getFieldDecorator('account')()}
);
});
mount();
expect(errorSpy).not.toHaveBeenCalled();
errorSpy.mockRestore();
});
});