rework email settings UX with guided flow and friendly errors
grouped providers by category, added per-provider key validation with cross-provider detection, friendly delivery error messages, retryable vs config error distinction, from-address in general settings, and "Save settings" button to match admin conventions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -240,6 +240,32 @@ defmodule BerrypodWeb.Admin.SettingsTest do
|
||||
end
|
||||
end
|
||||
|
||||
describe "from address" do
|
||||
setup %{conn: conn, user: user} do
|
||||
conn = log_in_user(conn, user)
|
||||
%{conn: conn}
|
||||
end
|
||||
|
||||
test "shows from address section", %{conn: conn} do
|
||||
{:ok, _view, html} = live(conn, ~p"/admin/settings")
|
||||
|
||||
assert html =~ "From address"
|
||||
assert html =~ "sender address"
|
||||
end
|
||||
|
||||
test "saves from address", %{conn: conn} do
|
||||
{:ok, view, _html} = live(conn, ~p"/admin/settings")
|
||||
|
||||
html =
|
||||
view
|
||||
|> form("form[phx-submit=\"save_from_address\"]", %{from_address: "shop@example.com"})
|
||||
|> render_submit()
|
||||
|
||||
assert html =~ "From address saved"
|
||||
assert Settings.get_setting("email_from_address") == "shop@example.com"
|
||||
end
|
||||
end
|
||||
|
||||
describe "advanced section" do
|
||||
setup %{conn: conn, user: user} do
|
||||
conn = log_in_user(conn, user)
|
||||
|
||||
Reference in New Issue
Block a user