It is a good idea to test that whether the correct data is being passed when you submit a form. One way to achieve this is by using a Jest spy function => jest.fn(). A spy function is a mock function than can be called in place of another function Continue Reading