mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-21 21:06:20 +02:00
⬆️ v3.0.0 (#704)
This commit is contained in:
parent
735056f25f
commit
c22b3abc4d
385 changed files with 19912 additions and 5250 deletions
|
@ -1,19 +1,33 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { expect, Page, test } from "@playwright/test";
|
||||
import smtpTester, { SmtpTester } from "smtp-tester";
|
||||
import { EditOptionsPage } from "tests/edit-options-page";
|
||||
import { NewPollPage } from "tests/new-poll-page";
|
||||
|
||||
test.describe("edit options", () => {
|
||||
test("should show warning when deleting options with votes in them", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/demo");
|
||||
let page: Page;
|
||||
let editOptionsPage: EditOptionsPage;
|
||||
let mailServer: SmtpTester;
|
||||
|
||||
await expect(page.locator('text="Lunch Meeting"')).toBeVisible();
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
mailServer = smtpTester.init(4025);
|
||||
const newPollPage = new NewPollPage(page);
|
||||
await newPollPage.goto();
|
||||
const pollPage = await newPollPage.createPollAndCloseDialog();
|
||||
await pollPage.addParticipant("Mark");
|
||||
editOptionsPage = await pollPage.editOptions();
|
||||
});
|
||||
|
||||
test.afterAll(async () => {
|
||||
mailServer.stop();
|
||||
});
|
||||
|
||||
test("should show warning when deleting options with votes in them", async () => {
|
||||
editOptionsPage.switchToSpecifyTimes();
|
||||
|
||||
await page.click("text='Manage'");
|
||||
await page.click("text='Edit options'");
|
||||
await page.click("[data-testid='specify-times-switch']");
|
||||
await page.click("text='12:00 PM'");
|
||||
await page.click("text='1:00 PM'");
|
||||
await page.locator("div[role='dialog']").locator("text='Save'").click();
|
||||
await page.getByRole("button", { name: "Save" }).click();
|
||||
await expect(page.locator('text="Are you sure?"')).toBeVisible();
|
||||
await page.click("text='Delete'");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue