Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test(' - renders wrapper with error', () => {
const element = wrapField(
{
showInlineError: true,
error: new Error(),
errorMessage: 'Error message',
},
<div>,
);
const wrapper = mount(element);
expect(wrapper.find(FormControl).prop('error')).toBe(true);
expect(wrapper.find(FormHelperText).text()).toBe('Error message');
});
</div>
test(' - renders wrapper with helper text', () => {
const element = wrapField({ helperText: 'Helper text' }, <div>);
const wrapper = mount(element);
expect(wrapper.find(FormHelperText).text()).toBe('Helper text');
});
</div>