improve email settings progressive enhancement and admin layout
Some checks failed
deploy / deploy (push) Has been cancelled
Some checks failed
deploy / deploy (push) Has been cancelled
- semantic HTML: step numbers inside h2, strong provider names, details for adapter configs, strong error messages, fieldset drawer toggle hidden - inline field errors via flash for no-JS controller fallback - single form POST button for test email (works with and without JS) - admin sidebar: remove brand/view-shop, move user email to footer nav - replace inline style with .admin-setup-step-spaced class - clean up unused CSS (.admin-brand, .admin-sidebar-header, etc.) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,14 +33,18 @@ defmodule BerrypodWeb.EmailSettingsControllerTest do
|
||||
assert Settings.get_setting("email_adapter") == "brevo"
|
||||
end
|
||||
|
||||
test "redirects with error on validation failure", %{conn: conn} do
|
||||
test "redirects with field errors on validation failure", %{conn: conn} do
|
||||
conn =
|
||||
post(conn, ~p"/admin/settings/email", %{
|
||||
email: %{adapter: "brevo", brevo: %{api_key: ""}}
|
||||
})
|
||||
|
||||
assert redirected_to(conn) =~ ~p"/admin/settings/email"
|
||||
assert Phoenix.Flash.get(conn.assigns.flash, :error) =~ "required"
|
||||
|
||||
field_errors = Phoenix.Flash.get(conn.assigns.flash, :field_errors)
|
||||
assert is_map(field_errors)
|
||||
assert field_errors |> Map.values() |> Enum.any?(&String.contains?(&1, "required"))
|
||||
assert Phoenix.Flash.get(conn.assigns.flash, :error_adapter) == "brevo"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user