fix email settings: hidden attr for no-CSS, block-level card labels
All checks were successful
deploy / deploy (push) Successful in 1m29s
All checks were successful
deploy / deploy (push) Successful in 1m29s
Non-selected adapter configs now get HTML hidden attribute so only the active config shows without CSS. Provider card labels use div instead of span for natural block stacking in text-only rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -251,6 +251,22 @@ defmodule BerrypodWeb.Admin.EmailSettingsTest do
|
||||
assert html =~ "Email provider"
|
||||
assert html =~ "sr-only"
|
||||
end
|
||||
|
||||
test "only selected adapter config is visible (hidden attribute)", %{conn: conn} do
|
||||
{:ok, view, _html} = live(conn, ~p"/admin/settings/email")
|
||||
|
||||
# Select SMTP
|
||||
view
|
||||
|> form("form[phx-change=\"form_change\"]", %{email: %{adapter: "smtp"}})
|
||||
|> render_change()
|
||||
|
||||
# SMTP should not be hidden
|
||||
refute has_element?(view, ~s([data-adapter="smtp"][hidden]))
|
||||
# Others should be hidden
|
||||
assert has_element?(view, ~s([data-adapter="brevo"][hidden]))
|
||||
assert has_element?(view, ~s([data-adapter="sendgrid"][hidden]))
|
||||
assert has_element?(view, ~s([data-adapter="postal"][hidden]))
|
||||
end
|
||||
end
|
||||
|
||||
describe "unauthenticated" do
|
||||
|
||||
Reference in New Issue
Block a user