feat: add smtp settings
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c4135308e6
commit
a4f3aa5d6f
23 changed files with 2424 additions and 152 deletions
|
|
@ -89,19 +89,16 @@ defmodule MvWeb.GlobalSettingsLiveTest do
|
|||
|
||||
test "send test email with valid address shows success or error result", %{conn: conn} do
|
||||
{:ok, view, _html} = live(conn, ~p"/settings")
|
||||
# If test email UI exists: fill recipient, click button, assert result area updates
|
||||
# Uses data-testid or button text "Send test email" / "Test email"
|
||||
|
||||
if has_element?(view, "[data-testid='smtp-test-email-form']") do
|
||||
# Submit the test-email form (phx-submit) with a valid recipient address
|
||||
view
|
||||
|> element("[data-testid='smtp-test-email-input']")
|
||||
|> render_change(%{"to_email" => "test@example.com"})
|
||||
view
|
||||
|> element("[data-testid='smtp-send-test-email']")
|
||||
|> render_click()
|
||||
# Result is either success or error message
|
||||
|> form("[data-testid='smtp-test-email-form']", %{"to_email" => "test@example.com"})
|
||||
|> render_submit()
|
||||
|
||||
# Result area must appear regardless of success or error
|
||||
assert has_element?(view, "[data-testid='smtp-test-result']")
|
||||
else
|
||||
# Section not yet implemented: just ensure page still renders
|
||||
assert render(view) =~ "Settings"
|
||||
end
|
||||
end
|
||||
|
|
@ -109,7 +106,7 @@ defmodule MvWeb.GlobalSettingsLiveTest do
|
|||
test "shows warning when SMTP is not configured in production", %{conn: conn} do
|
||||
# Concept: in prod, show warning "SMTP is not configured. Transactional emails..."
|
||||
# In test we only check that the section exists; warning visibility is env-dependent
|
||||
{:ok, view, html} = live(conn, ~p"/settings")
|
||||
{:ok, _view, html} = live(conn, ~p"/settings")
|
||||
assert html =~ "SMTP" or html =~ "E-Mail" or html =~ "Settings"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue