⬆️ v3.0.0 (#704)

This commit is contained in:
Luke Vella 2023-06-19 17:17:00 +01:00 committed by GitHub
parent 735056f25f
commit c22b3abc4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
385 changed files with 19912 additions and 5250 deletions

View file

@ -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'");
});