feat: preserve reports when screenshot upload fails

This commit is contained in:
ik
2026-09-03 18:20:50 +07:00
parent d407e8fcfd
commit 121225971d
5 changed files with 55 additions and 4 deletions
+29
View File
@@ -9,3 +9,32 @@ test("player can open an active spot", async ({ page }) => {
await expect(page.getByRole("heading", { name: "Точка 110:103" })).toBeVisible();
await expect(page.getByRole("heading", { name: "Последние уловы" })).toBeVisible();
});
test("submitted catch appears publicly only after moderation", async ({ page }) => {
const player = `E2E Player ${Date.now()}`;
const x = 1000 + Date.now() % 8000;
const y = x + 1;
const spotTestId = `spot-${x}-${y}`;
await page.goto("/report");
await page.getByLabel("Координата X *").fill(String(x));
await page.getByLabel("Координата Y *").fill(String(y));
await page.getByLabel("Вес, граммы *").fill("6789");
await page.getByLabel("Ник игрока").fill(player);
await page.getByRole("button", { name: "Отправить на проверку" }).click();
await expect(page.getByText("Улов отправлен на модерацию. Спасибо!")).toBeVisible();
await page.goto("/");
await expect(page.getByTestId(spotTestId)).toHaveCount(0);
await page.goto("/admin/moderation");
await page.getByLabel("Административный токен").fill("change-me-in-production");
await page.getByRole("button", { name: "Открыть очередь" }).click();
const report = page.locator(".moderation-card").filter({ hasText: player });
await expect(report).toBeVisible();
await report.getByRole("button", { name: "Одобрить" }).click();
await expect(report).toHaveCount(0);
await page.goto("/");
await expect(page.getByTestId(spotTestId)).toBeVisible();
});