diff --git a/__tests__/index.test.js b/__tests__/index.test.js index 4ebfec5..190c860 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -84,24 +84,6 @@ test('step2', async () => { }); test('step3', async () => { - await userEvent.type(elements.nameInput, 'Petya'); - await userEvent.type(elements.emailInput, 'wrong-email'); - expect(elements.submit).toBeDisabled(); - - await userEvent.clear(elements.nameInput); - await userEvent.clear(elements.emailInput); - await userEvent.type(elements.nameInput, ' '); - await userEvent.type(elements.emailInput, 'email@right'); - expect(elements.submit).toBeDisabled(); - - await userEvent.clear(elements.nameInput); - await userEvent.clear(elements.emailInput); - await userEvent.type(elements.nameInput, 'Petya'); - await userEvent.type(elements.emailInput, 'w@s'); - expect(elements.submit).not.toBeDisabled(); -}); - -test('step4', async () => { await userEvent.clear(elements.nameInput); await userEvent.clear(elements.emailInput); await userEvent.type(elements.nameInput, 'Petya'); @@ -123,6 +105,25 @@ test('step4', async () => { expect(elements.nameInput).toHaveClass('is-valid'); }); +test('step4', async () => { + await userEvent.type(elements.nameInput, 'Petya'); + await userEvent.type(elements.emailInput, 'wrong-email'); + expect(elements.submit).toBeDisabled(); + + await userEvent.clear(elements.nameInput); + await userEvent.clear(elements.emailInput); + await userEvent.type(elements.nameInput, ' '); + await userEvent.type(elements.emailInput, 'email@right'); + expect(elements.submit).toBeDisabled(); + + await userEvent.clear(elements.nameInput); + await userEvent.clear(elements.emailInput); + await userEvent.type(elements.nameInput, 'Petya'); + await userEvent.type(elements.emailInput, 'w@s'); + expect(elements.submit).not.toBeDisabled(); +}); + +