From b161ebad4d00fc4714e7e3e2997c052fe568f0d4 Mon Sep 17 00:00:00 2001 From: J2EEbbesen Date: Sun, 15 Dec 2024 21:29:49 -0600 Subject: [PATCH] Adding happy hour time to deals row when small screen (#53) --- .../Components/Layout/DealEventRowDeal.razor | 4 +++- .../Components/Layout/DealTableBody.razor | 2 +- .../Layout/DealEventRowDealTest.razor | 10 +++++++--- StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor | 5 ++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealEventRowDeal.razor b/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealEventRowDeal.razor index 09b9f34..50e7429 100644 --- a/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealEventRowDeal.razor +++ b/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealEventRowDeal.razor @@ -3,7 +3,9 @@ @if (!string.IsNullOrEmpty(Deal.HappyHour)) { - +
+
@Deal.HappyHour
+
} @if (!string.IsNullOrEmpty(Deal.Alcohol)) { diff --git a/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealTableBody.razor b/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealTableBody.razor index 4f5f28e..2f4b3e5 100644 --- a/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealTableBody.razor +++ b/StpFoodBlazor/StpFoodBlazor/Components/Layout/DealTableBody.razor @@ -14,7 +14,7 @@
@if (!string.IsNullOrEmpty(deal.URL)) { - + } diff --git a/StpFoodBlazor/StpFoodBlazorTest/Layout/DealEventRowDealTest.razor b/StpFoodBlazor/StpFoodBlazorTest/Layout/DealEventRowDealTest.razor index 017c514..57971a1 100644 --- a/StpFoodBlazor/StpFoodBlazorTest/Layout/DealEventRowDealTest.razor +++ b/StpFoodBlazor/StpFoodBlazorTest/Layout/DealEventRowDealTest.razor @@ -12,7 +12,9 @@ private static string alcoholIcon = ""; private static string happyHourIcon = - ""; + ""; + + private static string happyHourTime = "
16:00 - 18:00
"; public DealEventRowDealTest() { @@ -42,7 +44,8 @@ deal.HappyHour = "16:00 - 18:00"; var cut = ctx.Render(@); - Assert.Equal(happyHourIcon + @deal.Deal, + Assert.Equal("
" + + happyHourIcon + happyHourTime + "
" + @deal.Deal, cut.Markup); } @@ -53,7 +56,8 @@ deal.Alcohol = "x"; var cut = ctx.Render(@); - Assert.Equal(happyHourIcon + alcoholIcon + @deal.Deal, + Assert.Equal("
" + + happyHourIcon + happyHourTime + "
" + alcoholIcon + @deal.Deal, cut.Markup); } } diff --git a/StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor b/StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor index 984f2dd..08339f8 100644 --- a/StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor +++ b/StpFoodBlazor/StpFoodBlazorTest/Pages/DealsTest.razor @@ -153,7 +153,10 @@ public void DealsShouldWrapDealInURLSunday() { timeService.DayOfWeek = DayOfWeek.Sunday.ToString(); - var expected = "$5 beer, $7 select wine, $9 cocktail of the day"; + var expected = "
16:00 - 18:00
" + + "$5 beer, $7 select wine, $9 cocktail of the day
"; var cut = ctx.Render(@); getElements(cut); cut.Find("#happy-hour-checkbox").Change(true);