feat: focus home on top spot results

This commit is contained in:
ik
2026-09-20 20:38:17 +07:00
parent 3260f91495
commit 92bb878ced
3 changed files with 15 additions and 2 deletions
+13
View File
@@ -0,0 +1,13 @@
import { expect, test } from "@playwright/test";
test("home focuses the first screen on five results and keeps pagination", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto("/");
await expect(page.locator(".spot-card")).toHaveCount(5);
await expect(page.getByRole("navigation", { name: "Пагинация" })).toBeVisible();
await expect(page.getByRole("link", { name: "Следующая →" })).toHaveAttribute("href", /offset=5/);
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
expect(overflow).toBeLessThanOrEqual(0);
});