feat: save local fishing plans
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

This commit is contained in:
ik
2026-09-20 20:05:50 +07:00
parent e31fbe996d
commit 3f0a02a9b9
4 changed files with 46 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
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");
});