meal categories
This commit is contained in:
+9
-1
@@ -11,9 +11,17 @@ export async function registerAndLogin(page: Page, email: string) {
|
||||
}
|
||||
|
||||
/** Creates a meal with the given name and markdown description. */
|
||||
export async function createMeal(page: Page, name: string, description: string) {
|
||||
export async function createMeal(
|
||||
page: Page,
|
||||
name: string,
|
||||
description: string,
|
||||
category?: string,
|
||||
) {
|
||||
await page.goto("/meals/new");
|
||||
await page.fill("#meal-name", name);
|
||||
if (category) {
|
||||
await page.selectOption("#meal-category", { label: category });
|
||||
}
|
||||
await page.fill("#meal-description", description);
|
||||
await page.click('button:has-text("Save meal")');
|
||||
await expect(page).toHaveURL(/\/meals\/\d+/);
|
||||
|
||||
Reference in New Issue
Block a user