meal eaten checkbox
ci/woodpecker/push/fmt Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2026-08-09 21:07:17 -04:00
parent a1076a0731
commit 2fe8f18589
9 changed files with 216 additions and 3 deletions
+28
View File
@@ -96,3 +96,31 @@ test("removing a meal from a list removes its ingredients", async ({ page }) =>
await expect(page.locator(".item-row").filter({ hasText: "Tomato" })).toHaveCount(0);
await expect(row).toHaveCount(0);
});
test("a meal can be checked off without removing it from the list", async ({ page }) => {
await registerAndLogin(page, "alice@example.com");
await createMealWithIngredients(page, "Spaghetti Bolognese", [{ name: "Penne" }]);
await createList(page, "Weekly shop");
await page.click(".add-meal-button");
const picker = page.locator(".meal-picker-backdrop");
await picker.locator(".meal-picker-button").filter({ hasText: "Spaghetti Bolognese" }).click();
const panel = page.locator("#list-meals-panel");
const row = panel.locator(".list-meal-row").filter({ hasText: "Spaghetti Bolognese" });
await expect(row).toBeVisible();
await expect(row.locator(".list-meal-check-button")).not.toHaveClass(/is-.*checked/);
// Check the meal off as eaten.
await row.locator(".list-meal-check-button").click();
await expect(row).toHaveClass(/is-checked/);
await expect(row.locator(".list-meal-check-button")).toHaveText("✓");
// The meal is still on the list, not removed.
await expect(row).toBeVisible();
await expect(page.locator(".item-row").filter({ hasText: "Penne" })).toBeVisible();
// Unchecking restores it.
await row.locator(".list-meal-check-button").click();
await expect(row).not.toHaveClass(/is-checked/);
await expect(row).toBeVisible();
});