diff --git a/lib/simpleshop_theme_web/components/page_templates/pdp.html.heex b/lib/simpleshop_theme_web/components/page_templates/pdp.html.heex index 643c142..14d9f6d 100644 --- a/lib/simpleshop_theme_web/components/page_templates/pdp.html.heex +++ b/lib/simpleshop_theme_web/components/page_templates/pdp.html.heex @@ -13,21 +13,18 @@
<.breadcrumb items={ - [ - %{label: "Home", page: "home", href: "/"} - ] ++ - if @product.category do - [ - %{ - label: @product.category, - page: "collection", - href: - "/collections/#{@product.category |> String.downcase() |> String.replace(" ", "-")}" - } - ] - else - [] - end ++ + if @product.category do + [ + %{ + label: @product.category, + page: "collection", + href: + "/collections/#{@product.category |> String.downcase() |> String.replace(" ", "-")}" + } + ] + else + [] + end ++ [%{label: @product.name, current: true}] } mode={@mode} diff --git a/test/simpleshop_theme_web/live/shop_live/product_show_test.exs b/test/simpleshop_theme_web/live/shop_live/product_show_test.exs index 43941e9..0df53d2 100644 --- a/test/simpleshop_theme_web/live/shop_live/product_show_test.exs +++ b/test/simpleshop_theme_web/live/shop_live/product_show_test.exs @@ -27,19 +27,12 @@ defmodule SimpleshopThemeWeb.ShopLive.ProductShowTest do assert html =~ SimpleshopTheme.Cart.format_price(product.price) end - test "renders breadcrumb with Home link", %{conn: conn} do - product = List.first(PreviewData.products()) - {:ok, _view, html} = live(conn, ~p"/products/#{product.id}") - - assert html =~ "Home" - assert html =~ ~s(href="/") - end - test "renders breadcrumb with category link", %{conn: conn} do product = List.first(PreviewData.products()) {:ok, _view, html} = live(conn, ~p"/products/#{product.id}") assert html =~ product.category + assert html =~ "/collections/" end test "renders add to cart button", %{conn: conn} do