Bartosz Kz
0 deals
on 2023-07-10
I am trying to test one form that uses:
import { useForm, Controller } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
I have a problem in creating a test. When I click Submit => fireEvent.click(screen.getByText("Submit"))
I get the error "TypeError: Cannot read properties of undefined (reading 'length')" error related to zod.
I need help writing 1 test that checks if the data is sending correctly.
e.g. using:
expect(mockUpdateUser).toHaveBeenCalled();
and
expect(mockUpdateUser).toHaveBeenCalledWith({first_name: "xxx", etc});
Help with desktop sharing, zoom, google meets, etc.