import { test, expect } from "@playwright/test"; test("garden containers happy path", async ({ page }) => { await page.goto("/garden"); await expect(page.getByRole("heading", { name: "Garden" })).toBeVisible(); // Create a container await page.getByRole("button", { name: /new container/i }).click(); await page.getByLabel("Name").fill("Living Room Shelf"); await page.getByLabel("Type").selectOption("shelf"); await page.getByRole("button", { name: /save|create/i }).click(); // Verify it appears in the list await expect(page.getByText("Living Room Shelf")).toBeVisible(); // Open the container detail await page.getByText("Living Room Shelf").click(); await expect(page.getByRole("heading", { name: "Living Room Shelf" })).toBeVisible(); // Edit the container await page.getByRole("button", { name: /edit/i }).click(); await page.getByLabel("Name").fill("Living Room Shelf (Updated)"); await page.getByRole("button", { name: /save/i }).click(); await expect(page.getByRole("heading", { name: "Living Room Shelf (Updated)" })).toBeVisible(); // Delete the container await page.getByRole("button", { name: /delete/i }).click(); await page.getByRole("button", { name: /confirm|yes/i }).click(); await expect(page).toHaveURL(/\/garden/); await expect(page.getByText("Living Room Shelf")).toBeHidden(); });