diff --git a/drizzle/0006_recipe_instructions.sql b/drizzle/0006_recipe_instructions.sql new file mode 100644 index 0000000..5e19f3e --- /dev/null +++ b/drizzle/0006_recipe_instructions.sql @@ -0,0 +1,7 @@ +ALTER TABLE "recipes" ADD COLUMN "description" text;--> statement-breakpoint +ALTER TABLE "recipes" ADD COLUMN "prep_minutes" integer;--> statement-breakpoint +ALTER TABLE "recipes" ADD COLUMN "cook_minutes" integer;--> statement-breakpoint +ALTER TABLE "recipes" ADD COLUMN "steps" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint +ALTER TABLE "recipes" ADD COLUMN "tips" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint +ALTER TABLE "recipes" ADD COLUMN "equipment" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint +ALTER TABLE "recipes" ADD COLUMN "origin_recipe_id" text; \ No newline at end of file diff --git a/drizzle/meta/0006_snapshot.json b/drizzle/meta/0006_snapshot.json new file mode 100644 index 0000000..912975d --- /dev/null +++ b/drizzle/meta/0006_snapshot.json @@ -0,0 +1,1099 @@ +{ + "id": "7aa14a08-c6c4-4806-aa3d-0ba4ce69589a", + "prevId": "c6419cad-27e8-4cec-a86f-6043ad3194d1", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "account_userId_idx": { + "name": "account_userId_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_user_id_user_id_fk": { + "name": "account_user_id_user_id_fk", + "tableFrom": "account", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.event_dishes": { + "name": "event_dishes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "recipe_id": { + "name": "recipe_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "servings_per_person": { + "name": "servings_per_person", + "type": "double precision", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "event_dishes_event_recipe_unique": { + "name": "event_dishes_event_recipe_unique", + "columns": [ + { + "expression": "event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "recipe_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "event_dishes_event_id_events_id_fk": { + "name": "event_dishes_event_id_events_id_fk", + "tableFrom": "event_dishes", + "tableTo": "events", + "columnsFrom": [ + "event_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "event_dishes_recipe_id_recipes_id_fk": { + "name": "event_dishes_recipe_id_recipes_id_fk", + "tableFrom": "event_dishes", + "tableTo": "recipes", + "columnsFrom": [ + "recipe_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.events": { + "name": "events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host_id": { + "name": "host_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "host_name": { + "name": "host_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "starts_at": { + "name": "starts_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "timezone": { + "name": "timezone", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'UTC'" + }, + "share_code": { + "name": "share_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "maybe_percent": { + "name": "maybe_percent", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 50 + }, + "venmo_username": { + "name": "venmo_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "host_cover_cents": { + "name": "host_cover_cents", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "cancelled_at": { + "name": "cancelled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "details_changed_at": { + "name": "details_changed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "cover_emoji": { + "name": "cover_emoji", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cover_color": { + "name": "cover_color", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "events_share_code_unique": { + "name": "events_share_code_unique", + "nullsNotDistinct": false, + "columns": [ + "share_code" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.extra_costs": { + "name": "extra_costs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "amount_cents": { + "name": "amount_cents", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "extra_costs_event_id_events_id_fk": { + "name": "extra_costs_event_id_events_id_fk", + "tableFrom": "extra_costs", + "tableTo": "events", + "columnsFrom": [ + "event_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.guests": { + "name": "guests", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "guest_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "food_notes": { + "name": "food_notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "edit_token": { + "name": "edit_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "attended": { + "name": "attended", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "excluded": { + "name": "excluded", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "paid": { + "name": "paid", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "link_sent_at": { + "name": "link_sent_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "link_sent_amount_cents": { + "name": "link_sent_amount_cents", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "guests_event_id_events_id_fk": { + "name": "guests_event_id_events_id_fk", + "tableFrom": "guests", + "tableTo": "events", + "columnsFrom": [ + "event_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "guests_edit_token_unique": { + "name": "guests_edit_token_unique", + "nullsNotDistinct": false, + "columns": [ + "edit_token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.invitees": { + "name": "invitees", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "invitees_event_id_events_id_fk": { + "name": "invitees_event_id_events_id_fk", + "tableFrom": "invitees", + "tableTo": "events", + "columnsFrom": [ + "event_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plus_ones": { + "name": "plus_ones", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "guest_id": { + "name": "guest_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plus_ones_guest_id_guests_id_fk": { + "name": "plus_ones_guest_id_guests_id_fk", + "tableFrom": "plus_ones", + "tableTo": "guests", + "columnsFrom": [ + "guest_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recipe_items": { + "name": "recipe_items", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "recipe_id": { + "name": "recipe_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "emoji": { + "name": "emoji", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "per_serving": { + "name": "per_serving", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "unit": { + "name": "unit", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "buy_unit": { + "name": "buy_unit", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "units_per_buy": { + "name": "units_per_buy", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "price_cents": { + "name": "price_cents", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "recipe_items_recipe_id_recipes_id_fk": { + "name": "recipe_items_recipe_id_recipes_id_fk", + "tableFrom": "recipe_items", + "tableTo": "recipes", + "columnsFrom": [ + "recipe_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recipes": { + "name": "recipes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "owner_id": { + "name": "owner_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "emoji": { + "name": "emoji", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "default_servings_per_person": { + "name": "default_servings_per_person", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prep_minutes": { + "name": "prep_minutes", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cook_minutes": { + "name": "cook_minutes", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "steps": { + "name": "steps", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "tips": { + "name": "tips", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "equipment": { + "name": "equipment", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "origin_recipe_id": { + "name": "origin_recipe_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "session_userId_idx": { + "name": "session_userId_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "session_user_id_user_id_fk": { + "name": "session_user_id_user_id_fk", + "tableFrom": "session", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_token_unique": { + "name": "session_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shopping_state": { + "name": "shopping_state", + "schema": "", + "columns": { + "event_id": { + "name": "event_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "recipe_item_id": { + "name": "recipe_item_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "checked_qty": { + "name": "checked_qty", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "actual_cents": { + "name": "actual_cents", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "shopping_state_event_id_events_id_fk": { + "name": "shopping_state_event_id_events_id_fk", + "tableFrom": "shopping_state", + "tableTo": "events", + "columnsFrom": [ + "event_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "shopping_state_recipe_item_id_recipe_items_id_fk": { + "name": "shopping_state_recipe_item_id_recipe_items_id_fk", + "tableFrom": "shopping_state", + "tableTo": "recipe_items", + "columnsFrom": [ + "recipe_item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "shopping_state_event_item_unique": { + "name": "shopping_state_event_item_unique", + "nullsNotDistinct": false, + "columns": [ + "event_id", + "recipe_item_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_email_unique": { + "name": "user_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification": { + "name": "verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "verification_identifier_idx": { + "name": "verification_identifier_idx", + "columns": [ + { + "expression": "identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.guest_status": { + "name": "guest_status", + "schema": "public", + "values": [ + "yes", + "maybe", + "no" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 1c0c244..3232eb7 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -43,6 +43,13 @@ "when": 1794797697309, "tag": "0005_event_lifecycle", "breakpoints": true + }, + { + "idx": 6, + "version": "7", + "when": 1794862847889, + "tag": "0006_recipe_instructions", + "breakpoints": true } ] } \ No newline at end of file diff --git a/e2e/flow.spec.ts b/e2e/flow.spec.ts index 5ecd1ad..23254b4 100644 --- a/e2e/flow.spec.ts +++ b/e2e/flow.spec.ts @@ -37,7 +37,8 @@ async function createEvent(page: Page, title: string): Promise<{ eventUrl: strin const submit = page.getByRole("button", { name: "Create event" }); await expect(submit).toBeEnabled(); await submit.click(); - await expect(page.getByRole("heading", { name: title })).toBeVisible(); + await expect(page.locator(".event-bar-title")).toHaveText(title); + await expect(page.getByRole("navigation", { name: "Event sections" })).toBeVisible(); const eventUrl = page.url(); // The dashboard shows the guest link under the event. @@ -84,7 +85,7 @@ test("host plans a burger night from sign-up to a changed RSVP", async ({ page, // 1. The host signs up, creates the event and reads the share link. await signUp(page, "Hannah Host"); const { eventUrl, shareLink } = await createEvent(page, "Burger Night"); - await expect(page.getByText("Plan for ~0", { exact: true })).toBeVisible(); + await expect(page.getByText(/~0 guests/)).toBeVisible(); // Hosts can invite immediately without leaving the event. await expect(page.getByRole("button", { name: "Copy link", exact: true })).toBeVisible(); await page.getByLabel(/Who did you invite/).fill("Pat Guest\nMorgan Unanswered"); @@ -121,7 +122,7 @@ test("host plans a burger night from sign-up to a changed RSVP", async ({ page, // 4. The host's Guests tab counts both heads. await page.goto(eventUrl); await expect(page.getByText(/^2 confirmed/)).toBeVisible(); - await expect(page.getByText("Plan for ~2", { exact: true })).toBeVisible(); + await expect(page.getByText(/~2 guests/)).toBeVisible(); await expect(page.getByText("Pat Guest")).toBeVisible(); // 5. Add the starter Burgers dish on the Menu tab. @@ -135,18 +136,18 @@ test("host plans a burger night from sign-up to a changed RSVP", async ({ page, await preview.getByLabel("Try a headcount").fill("8"); await expect(preview.getByRole("status")).toContainText("Previewing 8 people"); await expect(preview.locator(".whatif-yield-value")).toContainText("12 burgers"); - await expect(page.getByText("Plan for ~2", { exact: true })).toBeVisible(); + await expect(page.getByText(/~2 guests/)).toBeVisible(); // A kitchen sheet uses saved quantities and remains readable in print media. await page.getByRole("link", { name: /Kitchen sheet/ }).click(); await expect(page.getByRole("heading", { name: "Kitchen sheet", exact: true })).toBeVisible(); await expect(page.locator(".kitchen-dish-servings")).toContainText("3 burgers"); await expect(page.locator(".kitchen-headcount")).toContainText("2 confirmed"); - await expect(page.getByRole("link", { name: "Menu", exact: true })).toHaveAttribute("aria-current", "page"); + // The Kitchen sheet is its own screen, so no section claims to be current. + await expect(page.locator(".event-tab-bar a[aria-current='page']")).toHaveCount(0); await page.emulateMedia({ media: "print" }); await expect(page.locator(".kitchen-sheet")).toBeVisible(); - await expect(page.locator(".event-invite")).toBeHidden(); - await expect(page.locator(".event-tabs")).toBeHidden(); + await expect(page.locator(".event-tab-bar")).toBeHidden(); await expect(page.getByRole("button", { name: "Print kitchen sheet" })).toBeHidden(); await page.emulateMedia({ media: "screen" }); await page.getByRole("link", { name: "Back to Menu" }).click(); @@ -177,15 +178,13 @@ test("host plans a burger night from sign-up to a changed RSVP", async ({ page, // 7. Split: tick the guest as attended and see what they owe. await page.getByRole("link", { name: "Split" }).click(); - const prompt = page.getByText("Tick who came to see what everyone owes"); - await expect(prompt).toBeVisible(); const came = page.getByRole("checkbox", { name: "Pat Guest came" }); + const guestRow = rowOf(page.getByText("Pat Guest", { exact: true })); await expect(async () => { await came.check(); - await expect(prompt).toHaveCount(0, { timeout: 1000 }); + await expect(came).toBeChecked({ timeout: 1000 }); + await expect(guestRow).toContainText(/\$\d+\.\d{2}/, { timeout: 1000 }); }).toPass(); - const guestRow = rowOf(page.getByText("Pat Guest", { exact: true })); - await expect(guestRow).toContainText(/\$\d+\.\d{2}/); await expect(guestRow).not.toContainText("$0.00"); // 8. The guest reopens their link (the cookie sends them to their edit page) and backs out. @@ -198,7 +197,7 @@ test("host plans a burger night from sign-up to a changed RSVP", async ({ page, // 9. The host's count drops to zero. await page.goto(eventUrl); await expect(page.getByText(/^0 confirmed/)).toBeVisible(); - await expect(page.getByText("Plan for ~0", { exact: true })).toBeVisible(); + await expect(page.getByText(/~0 guests/)).toBeVisible(); await expect(page.getByRole("button", { name: "Copy reminder for Pat Guest" })).toHaveCount(0); // The same event is usable on desktop and fits the phone without sideways scroll. expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true); diff --git a/src/app/e/[code]/g/[token]/page.tsx b/src/app/e/[code]/g/[token]/page.tsx index db2d624..25995d9 100644 --- a/src/app/e/[code]/g/[token]/page.tsx +++ b/src/app/e/[code]/g/[token]/page.tsx @@ -76,7 +76,7 @@ export default async function GuestEditPage({ params }: PageProps<"/e/[code]/g/[ {cancelled ? null : ( Not you? Answer as someone else diff --git a/src/app/e/[code]/page.tsx b/src/app/e/[code]/page.tsx index 1976d40..cb56619 100644 --- a/src/app/e/[code]/page.tsx +++ b/src/app/e/[code]/page.tsx @@ -124,9 +124,6 @@ export default async function GuestPage({ params, searchParams }: PageProps<"/e/ {cancelled ? null : (