mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-24 22:36:22 +02:00
✨ New Login Page (#1504)
This commit is contained in:
parent
655f38203a
commit
f5ab25ed1f
67 changed files with 1669 additions and 713 deletions
|
@ -40,7 +40,7 @@ test.describe.serial(() => {
|
|||
.getByPlaceholder("jessie.smith@example.com")
|
||||
.fill(testUserEmail);
|
||||
|
||||
await page.getByRole("button", { name: "Login with Email" }).click();
|
||||
await page.getByRole("button", { name: "Continue with Email" }).click();
|
||||
|
||||
// Make sure the user doesn't exist yet and that logging in is not possible
|
||||
await expect(
|
||||
|
@ -51,7 +51,7 @@ test.describe.serial(() => {
|
|||
test("user registration", async ({ page }) => {
|
||||
await page.goto("/register");
|
||||
|
||||
await page.getByText("Create an account").waitFor();
|
||||
await page.getByText("Create Your Account").waitFor();
|
||||
|
||||
await page.getByPlaceholder("Jessie Smith").fill("Test User");
|
||||
await page
|
||||
|
@ -60,15 +60,15 @@ test.describe.serial(() => {
|
|||
|
||||
await page.getByRole("button", { name: "Continue", exact: true }).click();
|
||||
|
||||
const codeInput = page.getByPlaceholder("Enter your 6-digit code");
|
||||
|
||||
const code = await getCode();
|
||||
|
||||
await page.getByText("Finish Registering").waitFor();
|
||||
|
||||
const codeInput = page.getByPlaceholder("Enter your 6-digit code");
|
||||
|
||||
await codeInput.fill(code);
|
||||
|
||||
await page.getByRole("button", { name: "Continue", exact: true }).click();
|
||||
|
||||
await page.waitForURL("/");
|
||||
await expect(page.getByText("Test User")).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -76,7 +76,7 @@ test.describe.serial(() => {
|
|||
test("can't register with the same email", async ({ page }) => {
|
||||
await page.goto("/register");
|
||||
|
||||
await page.getByText("Create an account").waitFor();
|
||||
await page.getByText("Create Your Account").waitFor();
|
||||
|
||||
await page.getByPlaceholder("Jessie Smith").fill("Test User");
|
||||
await page
|
||||
|
@ -97,7 +97,7 @@ test.describe.serial(() => {
|
|||
.getByPlaceholder("jessie.smith@example.com")
|
||||
.fill(testUserEmail);
|
||||
|
||||
await page.getByRole("button", { name: "Login with Email" }).click();
|
||||
await page.getByRole("button", { name: "Continue with Email" }).click();
|
||||
|
||||
const html = await captureEmailHTML(testUserEmail);
|
||||
|
||||
|
@ -111,13 +111,27 @@ test.describe.serial(() => {
|
|||
|
||||
await page.goto(magicLink);
|
||||
|
||||
await page.getByRole("button", { name: "Continue", exact: true }).click();
|
||||
|
||||
await page.waitForURL("/");
|
||||
await page.getByRole("button", { name: "Login", exact: true }).click();
|
||||
|
||||
await expect(page.getByText("Test User")).toBeVisible();
|
||||
});
|
||||
|
||||
test("shows error for invalid verification code", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
|
||||
await page
|
||||
.getByPlaceholder("jessie.smith@example.com")
|
||||
.fill(testUserEmail);
|
||||
|
||||
await page.getByRole("button", { name: "Continue with Email" }).click();
|
||||
|
||||
await page.getByPlaceholder("Enter your 6-digit code").fill("000000");
|
||||
|
||||
await expect(
|
||||
page.getByText("Your verification code is incorrect or has expired"),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("can login with verification code", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
|
||||
|
@ -125,16 +139,12 @@ test.describe.serial(() => {
|
|||
.getByPlaceholder("jessie.smith@example.com")
|
||||
.fill(testUserEmail);
|
||||
|
||||
await page.getByRole("button", { name: "Login with Email" }).click();
|
||||
await page.getByRole("button", { name: "Continue with Email" }).click();
|
||||
|
||||
const code = await getCode();
|
||||
|
||||
await page.getByPlaceholder("Enter your 6-digit code").fill(code);
|
||||
|
||||
await page.getByRole("button", { name: "Continue", exact: true }).click();
|
||||
|
||||
await page.waitForURL("/");
|
||||
|
||||
await expect(page.getByText("Test User")).toBeVisible();
|
||||
});
|
||||
|
||||
|
@ -145,16 +155,12 @@ test.describe.serial(() => {
|
|||
.getByPlaceholder("jessie.smith@example.com")
|
||||
.fill("Test@example.com");
|
||||
|
||||
await page.getByRole("button", { name: "Login with Email" }).click();
|
||||
await page.getByRole("button", { name: "Continue with Email" }).click();
|
||||
|
||||
const code = await getCode();
|
||||
|
||||
await page.getByPlaceholder("Enter your 6-digit code").fill(code);
|
||||
|
||||
await page.getByRole("button", { name: "Continue", exact: true }).click();
|
||||
|
||||
await page.waitForURL("/");
|
||||
|
||||
await expect(page.getByText("Test User")).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue