test: cover waterbody error states
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("unknown spot exposes an unavailable state without a misleading coordinate", async ({ page }) => {
|
||||
await page.goto("/spots/not-a-real-spot");
|
||||
|
||||
await expect(page.getByRole("heading", { name: "Точка недоступна" })).toBeVisible();
|
||||
await expect(page.getByText("API не ответил или такой точки нет.")).toBeVisible();
|
||||
await expect(page.getByRole("navigation", { name: "Навигационная цепочка" })).toContainText("Точка недоступна");
|
||||
await expect(page.getByText(/Точность координат:/)).toHaveCount(0);
|
||||
});
|
||||
@@ -17,3 +17,11 @@ test("unknown waterbody slug has a navigable not-found state", async ({ page })
|
||||
await expect(page.getByRole("alert")).toContainText("Такого водоёма нет в справочнике");
|
||||
await expect(page.getByRole("link", { name: "Открыть каталог" })).toHaveAttribute("href", "/waterbodies");
|
||||
});
|
||||
|
||||
test("unknown waterbody/fish pair keeps a clear not-found state", async ({ page }) => {
|
||||
await page.goto("/waterbodies/р-вьюнок/not-a-real-fish");
|
||||
|
||||
await expect(page.getByRole("heading", { name: "Данные не найдены" })).toBeVisible();
|
||||
await expect(page.getByRole("alert")).toContainText("Такого сочетания нет в справочнике");
|
||||
await expect(page.getByRole("link", { name: "Вернуться на главную" })).toHaveAttribute("href", "/");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user