mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-24 06:58:10 -05:00
* Initial * Progress * Fix * Progress * Notifications list page * BADGE_MANAGER_ADDED * Mark as seen initial * Split tables * Progress * Fix styles * Push notifs initial * Progress * Rename * Routines * Progress * Add e2e tests * Done? * Try updating actions * Consistency * Dep fix * A couple fixes
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
import { impersonate, navigate, seed, selectUser } from "~/utils/playwright";
|
|
import { badgePage } from "~/utils/urls";
|
|
import { NZAP_TEST_ID } from "../app/db/seed/constants";
|
|
|
|
test.describe("Badges", () => {
|
|
test("adds a badge sending a notification", async ({ page }) => {
|
|
await seed(page);
|
|
await impersonate(page);
|
|
await navigate({
|
|
page,
|
|
url: badgePage(1),
|
|
});
|
|
|
|
await page.getByRole("link", { name: "Edit", exact: true }).click();
|
|
|
|
await selectUser({
|
|
page,
|
|
userName: "N-ZAP",
|
|
labelName: "Add new owner",
|
|
});
|
|
|
|
await page.getByRole("button", { name: "Save", exact: true }).click();
|
|
|
|
await impersonate(page, NZAP_TEST_ID);
|
|
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.getByText("See all").click();
|
|
|
|
await expect(
|
|
page.getByRole("heading", { name: "Notifications" }),
|
|
).toBeVisible();
|
|
});
|
|
});
|