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
+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);
});