I have the following component that takes control as an argument:
const TexInputMUI = (props) => {
const { control, variant, margin, ...rest } = props
return (
<Controller
name='myMUItf'
defaultValue=''
control={control}
render={({ field }) => (
<TextField
{...field}
variant={variant}
margin={margin}
label='A simple MIU text field'
{...rest}
/>
)}
/>
)
}
And, I have a simple test that wants to check whether the component rendered or not
test("Render text input without crashing", () => {
const { getByLabelText } = render(<TextInputMUI control={}/>);
const textField = getByLabelText(/A simple MIU text field/);
});
Now, the problem is that I don't know how to pass control as a argument in my test.
Can anyone help?