test: verify clean production bootstrap

This commit is contained in:
ik
2026-09-06 14:34:05 +07:00
parent 66fb1625da
commit 0f075469c8
9 changed files with 90 additions and 16 deletions
@@ -0,0 +1,23 @@
import { expect, test } from "@playwright/test";
test("production bootstrap supports submission and moderation", async ({ page, request }) => {
const player = `Bootstrap Player ${Date.now()}`;
const x = 7000 + Date.now() % 1000;
const y = x + 1;
await page.goto("/");
await expect(page.getByRole("heading", { name: "Выбирай место, пока клюёт." })).toBeVisible();
await page.goto("/report");
await page.getByLabel("Координата X *").fill(String(x));
await page.getByLabel("Координата Y *").fill(String(y));
await page.getByLabel("Вес, граммы *").fill("4321");
await page.getByLabel("Ник игрока").fill(player);
await page.getByRole("button", { name: "Отправить на проверку" }).click();
await expect(page.getByText("Улов отправлен на модерацию. Спасибо!")).toBeVisible();
const response = await request.get(`${process.env.BOOTSTRAP_API_URL}/api/v1/admin/catch-reports?status=pending`, {
headers: { Authorization: `Bearer ${process.env.BOOTSTRAP_ADMIN_TOKEN}` },
});
expect(response.ok()).toBeTruthy();
expect(await response.text()).toContain(player);
});