Waiting ajax request


I’m trying to wait for an ajax request but can’t seem to find a solution.

Here is my test :

test('Show error on invalid email', async ({ browser }) => {

  const page = await browser.visit('/')

  await page
    .type('[name="firstname"]', 'firstname')
    .type('[name="lastname"]', 'lastname')
    .type('[name="phone"]', '0000000000')
    .type('[name="register_email"]', 'a@a')
    .type('[name="register_password"]', 'ceciestunmotdepasse')

  await page

  await page
    .assertAttribute('#email_error', 'data-original-tooltip', 'Invalid email')



Why the timeout set at 0 ? You should expend it if the call take time not reduce it