mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-21 04:46:22 +02:00
✨ Skip user details step for logged in users (#602)
This commit is contained in:
parent
f858bcc5f4
commit
d8e3dcd357
41 changed files with 548 additions and 636 deletions
|
@ -1,5 +1,4 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { load } from "cheerio";
|
||||
import smtpTester, { SmtpTester } from "smtp-tester";
|
||||
|
||||
test.describe.serial(() => {
|
||||
|
@ -60,34 +59,11 @@ test.describe.serial(() => {
|
|||
pollUrl = page.url();
|
||||
});
|
||||
|
||||
test("enable notifications", async ({ page, baseURL }) => {
|
||||
test("notifications", async ({ page }) => {
|
||||
await page.goto(pollUrl);
|
||||
await page.getByTestId("notifications-toggle").click();
|
||||
|
||||
const { email } = await mailServer.captureOne("john.doe@email.com", {
|
||||
wait: 5000,
|
||||
});
|
||||
|
||||
expect(email.headers.subject).toBe("Please verify your email address");
|
||||
|
||||
const $ = load(email.html);
|
||||
const verifyLink = $("#verifyEmailUrl").attr("href");
|
||||
|
||||
expect(verifyLink).toContain(baseURL);
|
||||
|
||||
if (!verifyLink) {
|
||||
throw new Error("Could not get verification link from email");
|
||||
}
|
||||
|
||||
await page.goto(verifyLink);
|
||||
|
||||
await expect(
|
||||
page.getByText("Notifications have been enabled for Monthly Meetup"),
|
||||
).toBeVisible();
|
||||
|
||||
page.getByText("Click here").click();
|
||||
|
||||
await expect(page.getByTestId("poll-title")).toHaveText("Monthly Meetup");
|
||||
expect(page.getByTestId("login-modal")).toBeVisible();
|
||||
});
|
||||
|
||||
// delete the poll we just created
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue