mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 15:56:19 -05:00
* 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
77 lines
1.9 KiB
TypeScript
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"));
|
|
});
|
|
});
|