diff --git a/test/berrypod_web/live/shop/product_show_test.exs b/test/berrypod_web/live/shop/product_show_test.exs index 4fd78e8..e1e957a 100644 --- a/test/berrypod_web/live/shop/product_show_test.exs +++ b/test/berrypod_web/live/shop/product_show_test.exs @@ -305,6 +305,12 @@ defmodule BerrypodWeb.Shop.ProductShowTest do end describe "Add to cart" do + test "add to basket button is a submit button inside the form", %{conn: conn, print: print} do + {:ok, view, _html} = live(conn, ~p"/products/#{print.slug}") + + assert has_element?(view, "form[phx-submit='add_to_cart'] button[type='submit']", "Add to basket") + end + test "add to cart opens the cart drawer", %{conn: conn, print: print} do {:ok, view, _html} = live(conn, ~p"/products/#{print.slug}")