Files
rf4-spotter/apps/web/tests/saved-plan.spec.ts
T
ik 3f0a02a9b9
CI / backend-and-migrations (push) Waiting to run
CI / astro-build (push) Waiting to run
CI / dependency-audit (push) Waiting to run
CI / compose-e2e (push) Waiting to run
feat: save local fishing plans
2026-09-20 20:05:50 +07:00

19 lines
995 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { expect, test } from "@playwright/test";
test("spot can be saved to a five-item local fishing plan and survives reload", async ({ page }) => {
await page.goto("/spots/vyunok-6331x6332");
await page.evaluate(() => localStorage.removeItem("rf4spotter:fishing-plan"));
await page.reload();
const save = page.getByRole("button", { name: "Сохранить в план" });
await expect(save).toHaveAttribute("aria-pressed", "false");
await save.click();
await expect(page.getByRole("button", { name: "В плане" })).toHaveAttribute("aria-pressed", "true");
await expect(page.getByText("Добавлено в план")).toBeVisible();
await page.reload();
await expect(page.getByRole("button", { name: "В плане" })).toHaveAttribute("aria-pressed", "true");
await page.getByRole("button", { name: "В плане" }).click();
await expect(page.getByRole("button", { name: "Сохранить в план" })).toHaveAttribute("aria-pressed", "false");
});