From 7087db53867fa9bfb524e7c6a72fa85d24dfc5ef Mon Sep 17 00:00:00 2001 From: sseezov Date: Wed, 3 Apr 2024 14:54:09 +0700 Subject: [PATCH] swap 3 & 4 tests --- __tests__/index.test.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) 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(); +}); + +