Skip to content

Commit

Permalink
fix: general fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
souzaramon committed Jul 14, 2022
1 parent 8080885 commit 0b8f0c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
14 changes: 4 additions & 10 deletions apps/meteor/tests/e2e/01-forgot-password.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,32 @@ test.describe('Forgot Password', () => {
pageAuth = new Auth(page);
});

test('expect trigger a validation error if no email is provided', async () => {
test.beforeAll(async () => {
await page.goto('/');
await pageAuth.btnForgotPassword.click();
})

test('expect trigger a validation error if no email is provided', async () => {
await pageAuth.btnSubmit.click();

await expect(pageAuth.textErrorEmail).toBeVisible();
});

test('expect trigger a validation if a invalid email is provided (1)', async () => {
await page.goto('/');
await pageAuth.btnForgotPassword.click();

await pageAuth.inputEmail.type('mail');
await pageAuth.btnSubmit.click();

await expect(pageAuth.textErrorEmail).toBeVisible();
});

test('expect trigger a validation if a invalid email is provided (2)', async () => {
await page.goto('/');
await pageAuth.btnForgotPassword.click();

await pageAuth.inputEmail.type('mail@mail');
await pageAuth.btnSubmit.click();

await expect(pageAuth.textErrorEmail).toBeVisible();
});

test('expect to show a success toast if a valid email is provided', async () => {
await page.goto('/');
await pageAuth.btnForgotPassword.click();

await pageAuth.inputEmail.type('mail@mail.com');
await pageAuth.btnSubmit.click();

Expand Down
11 changes: 3 additions & 8 deletions apps/meteor/tests/e2e/02-register.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ test.describe('Register', () => {
pageAuth = new Auth(page);
});

test('expect trigger a validation error if no data is provided', async () => {
test.beforeAll(async () => {
await page.goto('/');
await pageAuth.btnRegister.click();
})

test('expect trigger a validation error if no data is provided', async () => {
await pageAuth.btnSubmit.click();

await expect(pageAuth.textErrorName).toBeVisible();
await expect(pageAuth.textErrorEmail).toBeVisible();
await expect(pageAuth.textErrorPassword).toBeVisible();
// await expect(pageAuth.textErrorPasswordConfirm).toBeVisible();
});

test('expect trigger a validation error if different password is provided', async () => {
await page.goto('/');
await pageAuth.btnRegister.click();

await pageAuth.inputName.type(faker.name.firstName());
await pageAuth.inputEmail.type(faker.internet.email());
await pageAuth.inputPassword.type('any_password');
Expand All @@ -38,9 +36,6 @@ test.describe('Register', () => {
});

test('expect successfully register a new user', async () => {
await page.goto('/');
await pageAuth.btnRegister.click();

await pageAuth.inputName.type(faker.name.firstName());
await pageAuth.inputEmail.type(faker.internet.email());
await pageAuth.inputPassword.type('any_password');
Expand Down

0 comments on commit 0b8f0c7

Please sign in to comment.