Ionic React testing library

I have tested:

it("login with invalid", async () => {
    const handler = jest.fn(e => e.preventDefault())
    const { findByTitle, findByText } = render(<Login />)
    const email = await findByTitle('Email');
    const password = await findByTitle('Password');
    const button = await findByText('SIGN IN & SHOP');

    await wait(() => {
      fireEvent.ionChange(email, '');
    });
    await wait(() => {
      fireEvent.ionChange(password, '');
    });
    await wait(() => {
      fireEvent.submit(button);
    });

    await expect(handler).toHaveBeenCalled();
    await findByText('Required');
  });

I have got an error:

How to fix it. Could you help me? :pensive:

I don’t really understand what you’re trying to do. You create a handler mock function, never use it anywhere, but somehow expect it to be called? What do you think will call that handler?