feat: garden containers crud (task 71)
- add listContainers/getContainer/searchContainers queries - add createContainer/updateContainer/deleteContainer server actions with logActivity - add ContainerList, ContainerDetail, ContainerForm client components - add /garden, /garden/containers/[id], /garden/containers/new pages - register garden.container entity with share + search in manifest - add sprout icon to NavIcon registry - add garden e2e test spec
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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();
|
||||
});
|
||||
Reference in New Issue
Block a user