Skip to content

Commit

Permalink
fix(e2e): errors in signup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lemilonkh committed Apr 24, 2024
1 parent 192907b commit 49b415a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/e2e/signup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect, type Page } from "@playwright/test";
import { randomUUID } from "node:crypto";

async function expectText(page: Page, text: string) {
await expect(page.getByText(text)).toBeVisible();
await expect(page.getByText(text).first()).toBeVisible();
}

test.beforeEach(async ({ page }) => {
Expand Down Expand Up @@ -63,7 +63,6 @@ test.describe("Signup", () => {
await expectText(page, "Minimum length");
await expectText(page, "Invalid invite code");
await expectText(page, "Please accept the terms");
await expectText(page, "Passwords don't match");
});

test("should require matching passwords", async ({ page }) => {
Expand All @@ -74,10 +73,13 @@ test.describe("Signup", () => {
await page.getByPlaceholder("Your full name").fill("Test Account");
await page
.getByPlaceholder("e.g. youremail@domain.com")
.fill("testopenearthorg");
.fill("e2e-test-fail@example.com");
await page.getByLabel("Password", { exact: true }).fill("Password1");
await page.getByLabel("Confirm Password").fill("Password2");
await page.getByPlaceholder("Enter the code you received").fill("123456");
await page
.locator('input[name="acceptTerms"] + .chakra-checkbox__control')
.click();
await page.getByRole("button", { name: "Create Account" }).click();

await expect(page).toHaveURL(`/en/auth/signup`);
Expand Down

0 comments on commit 49b415a

Please sign in to comment.