Skip to content

Commit

Permalink
swap 3 & 4 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sseezov committed Apr 3, 2024
1 parent 9491827 commit 7087db5
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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();
});





Expand Down

0 comments on commit 7087db5

Please sign in to comment.