From 2b8166437a440385fd21ed88aaa050b0bf2b1738 Mon Sep 17 00:00:00 2001 From: Max Veytsman Date: Wed, 22 May 2024 16:37:54 -0400 Subject: [PATCH] Show item description in signup --- .../live/campaign_signup_live/show.ex | 16 ++++++++++++++-- .../live/campaign_signup_live_test.exs | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/bike_brigade_web/live/campaign_signup_live/show.ex b/lib/bike_brigade_web/live/campaign_signup_live/show.ex index b8df32b0..a86d2e5a 100644 --- a/lib/bike_brigade_web/live/campaign_signup_live/show.ex +++ b/lib/bike_brigade_web/live/campaign_signup_live/show.ex @@ -184,9 +184,21 @@ defmodule BikeBrigadeWeb.CampaignSignupLive.Show do defp get_delivery_size(assigns) do ~H""" -
+
1}> task_item.count - <%= Inflex.inflect(task_item.item.name, task_item.count) %> + + <%= if task_item.item.description && task_item.item.description != "" do %> +
+
+ + <%= Inflex.inflect(task_item.item.name, task_item.count) %> + + <%= task_item.item.description %> +
+
+ <% else %> + <%= Inflex.inflect(task_item.item.name, task_item.count) %> + <% end %>
""" end diff --git a/test/bike_brigade_web/live/campaign_signup_live_test.exs b/test/bike_brigade_web/live/campaign_signup_live_test.exs index 071088b1..9758abe1 100644 --- a/test/bike_brigade_web/live/campaign_signup_live_test.exs +++ b/test/bike_brigade_web/live/campaign_signup_live_test.exs @@ -201,8 +201,9 @@ defmodule BikeBrigadeWeb.CampaignSignupLiveTest do assert live |> element("[data-test-id=dropoff-name-#{ctx.task.id}]") |> render =~ "CJH" assert html =~ BikeBrigade.Locations.neighborhood(ctx.task.dropoff_location) - # We show the name of the item + # We show the name and description of the item assert html =~ "Burrito" + assert html =~ "a large burrito with all the fixings" end