sendou.ink/e2e/associations.spec.ts
Kalle b4cc185d1d
Some checks are pending
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run
Scrims (#2211)
* Initial

* Progress

* Initial UI

* Can submit request

* Progress

* Show text if no scrims

* Can cancel request, tabs

* Delete post

* Popover if can't delete

* Request rows

* Progress

* Scrim page initial

* Fix migration order

* Progress

* Progress

* Works again

* Make it compile

* Make it compile again

* Work

* Progress

* Progress

* Progress

* Associations initial

* Association visibility work

* notFoundVisibility form fields initial

* Progress

* Association leave/join + reset invite code

* Progress

* Select test

* Merge branch 'rewrite' into scrims

* Remeda for groupBy

* Select with search

* Outline styling for select

* Select done?

* Fix prop names

* Paginated badges

* Less important

* Select no results

* Handle limiting select width

* UserSearch non-working

* Fix problem from merge

* Remove UserSearch for now

* Remove todo

* Flaggable

* Remove TODOs

* i18n start + styling

* Progress

* i18n done

* Add association e2e test

* E2E tests

* Done?

* Couple leftovers
2025-04-20 22:51:23 +03:00

77 lines
1.9 KiB
TypeScript

import test, { expect } from "@playwright/test";
import { ADMIN_ID } from "~/constants";
import { NZAP_TEST_ID } from "~/db/seed/constants";
import {
impersonate,
isNotVisible,
navigate,
seed,
submit,
} from "~/utils/playwright";
import { associationsPage, scrimsPage } from "~/utils/urls";
test.describe("Associations", () => {
test("creates a new association", async ({ page }) => {
await seed(page);
await impersonate(page, NZAP_TEST_ID);
await navigate({
page,
url: "/",
});
await page.getByTestId("anything-adder-menu-button").click();
await page.getByTestId("menu-item-association").click();
await page.getByLabel("Name").fill("My Association");
await submit(page);
await expect(
page.getByRole("heading").filter({ hasText: "My Association" }),
).toBeVisible();
});
test("deletes an association", async ({ page }) => {
await seed(page);
await impersonate(page, ADMIN_ID);
await navigate({
page,
url: scrimsPage(),
});
await page.getByRole("link", { name: "Associations" }).click();
await expect(page.getByTestId("delete-association")).toHaveCount(2);
await page.getByTestId("delete-association").first().click();
await page.getByTestId("confirm-button").click();
await expect(page.getByTestId("delete-association")).toHaveCount(1);
});
test("joins and leaves an association", async ({ page }) => {
await seed(page);
await impersonate(page, ADMIN_ID);
await navigate({
page,
url: associationsPage(),
});
const inviteLink = await page
.getByLabel("Share link to add members")
.first()
.inputValue();
await impersonate(page, NZAP_TEST_ID);
await navigate({
page,
url: inviteLink.replace("https://sendou.ink", "http://localhost:5173"),
});
await submit(page);
await page.getByTestId("leave-team-button").click();
await page.getByTestId("confirm-button").click();
await isNotVisible(page.getByTestId("leave-team-button"));
});
});