add meal e2e test
ci/woodpecker/push/e2e Pipeline failed
ci/woodpecker/push/fmt Pipeline failed
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2026-08-01 22:47:41 -04:00
parent 77a9d49eb4
commit 4adcfb1377
2 changed files with 67 additions and 0 deletions
+13
View File
@@ -21,6 +21,7 @@ export async function createMeal(page: Page, name: string, description: string)
/** Creates a list and lands on its page. */
export async function createList(page: Page, name: string) {
await page.goto("/lists");
await page.fill("#list-name", name);
await page.click('button:has-text("Create list")');
await expect(page).toHaveURL(/\/lists\/\d+/);
@@ -45,3 +46,15 @@ export async function addIngredient(page: Page, name: string, quantity = "") {
await page.click("#add-ingredient-button");
await expect(page.locator(".ingredient-list").filter({ hasText: name })).toBeVisible();
}
/** Creates a meal and adds the given ingredients to it. */
export async function createMealWithIngredients(
page: Page,
name: string,
ingredients: Array<{ name: string; quantity?: string }>,
) {
await createMeal(page, name, "");
for (const ingredient of ingredients) {
await addIngredient(page, ingredient.name, ingredient.quantity ?? "");
}
}