test: cover tackle browser acceptance
This commit is contained in:
@@ -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);
|
||||
});
|
||||
Reference in New Issue
Block a user