Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70924

Ionic React testing library

$
0
0

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:

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 70924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>