sendou.ink/e2e/badges.spec.ts
Kalle 2b5b1b1948
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run
New match page (#3032)
2026-05-04 18:15:10 +03:00

50 lines
1.1 KiB
TypeScript

import { badgePage } from "~/utils/urls";
import { NZAP_TEST_ID } from "../app/db/seed/constants";
import {
expect,
impersonate,
navigate,
seed,
selectUser,
test,
} from "./helpers/playwright";
test.describe("Badges", () => {
test("adds a badge owner sending a notification", async ({ page }) => {
await seed(page);
await impersonate(page, NZAP_TEST_ID);
await navigate({
page,
url: badgePage(1),
});
await page.getByRole("link", { name: "Edit", exact: true }).click();
await selectUser({
page,
userName: "Sendou",
labelName: "Add new owner",
});
await page.getByRole("button", { name: "Submit", exact: true }).click();
await impersonate(page);
await navigate({
page,
url: "/",
});
await page.getByTestId("notifications-button").click();
await page.getByText("New badge (4v4 Sundaes)").click();
await expect(page).toHaveURL(badgePage(1));
await page.getByTestId("notifications-button").click();
await page.getByTestId("notifications-see-all-button").click();
await expect(
page.getByRole("heading", { name: "Notifications" }),
).toBeVisible();
});
});