test: cover tackle browser acceptance

This commit is contained in:
ik
2026-09-20 18:42:33 +07:00
parent 46251c635f
commit d541443a1a
3 changed files with 23 additions and 1 deletions
@@ -1,6 +1,10 @@
import { expect, test } from "@playwright/test";
test("production bootstrap supports submission and moderation", async ({ page, request }) => {
test.skip(
!process.env.BOOTSTRAP_API_URL || !process.env.BOOTSTRAP_ADMIN_TOKEN,
"requires BOOTSTRAP_API_URL and BOOTSTRAP_ADMIN_TOKEN; run deploy/test-production-bootstrap.sh",
);
const player = `Bootstrap Player ${Date.now()}`;
const x = 7000 + Date.now() % 1000;
const y = x + 1;
+18
View File
@@ -0,0 +1,18 @@
import { expect, test } from "@playwright/test";
test("tackle catalog exposes an explicit empty state for unmatched filters", async ({ page }) => {
await page.setViewportSize({ width: 320, height: 800 });
await page.goto("/tackle?category=lure&brand=NoSuchBrand&family=NoSuchFamily");
await expect(page.getByRole("heading", { name: "Подтверждённых карточек пока нет" })).toBeVisible();
await expect(page.getByRole("link", { name: "Сбросить" })).toHaveAttribute("href", "/tackle");
await expect(page.getByLabel("Категория")).toHaveValue("lure");
await expect(page.getByLabel("Бренд")).toHaveValue("NoSuchBrand");
await expect(page.getByLabel("Семейство")).toHaveValue("NoSuchFamily");
const dimensions = await page.evaluate(() => ({
clientWidth: document.documentElement.clientWidth,
scrollWidth: document.documentElement.scrollWidth,
}));
expect(dimensions.scrollWidth).toBeLessThanOrEqual(dimensions.clientWidth);
});