add test asserting order tracking form has no-JS action
All checks were successful
deploy / deploy (push) Successful in 36s

Checks the form renders with action='/contact/lookup' and method='post'
so it works when JS is unavailable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey 2026-02-24 23:11:12 +00:00
parent 6289c678f7
commit 79764c7766

View File

@ -35,6 +35,14 @@ defmodule BerrypodWeb.Shop.ContactTest do
end end
end end
describe "no-JS fallback" do
test "order tracking form has action for no-JS submission", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/contact")
assert has_element?(view, "form[action='/contact/lookup'][method='post']")
end
end
describe "order lookup" do describe "order lookup" do
test "sends magic link when orders exist for email", %{conn: conn} do test "sends magic link when orders exist for email", %{conn: conn} do
order_fixture(%{customer_email: "buyer@example.com", payment_status: "paid"}) order_fixture(%{customer_email: "buyer@example.com", payment_status: "paid"})