test: cover tackle browser acceptance
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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