feat(join): use join_description as the join-form field label

This commit is contained in:
Simon 2026-06-03 12:11:39 +02:00
parent cb5cb68483
commit aced57d0fd
2 changed files with 67 additions and 5 deletions

View file

@ -165,6 +165,34 @@ defmodule MvWeb.JoinLiveTest do
custom_field.name
)
end
@tag role: :unauthenticated
test "renders join_description with rendered link as label when set", %{conn: conn} do
{:ok, settings} = Membership.get_settings()
system_actor = Mv.Helpers.SystemActor.get_system_actor()
{:ok, custom_field} =
Membership.create_custom_field(
%{
name: "DSGVO",
value_type: :boolean,
join_description: "Akzeptiere die [Datenschutzerklärung](https://example.com/dsgvo)"
},
actor: system_actor
)
{:ok, _} =
Membership.update_settings(settings, %{
join_form_enabled: true,
join_form_field_ids: ["email", custom_field.id],
join_form_field_required: %{"email" => true, custom_field.id => false}
})
{:ok, _view, html} = live(conn, "/join")
assert html =~ ~s(<a href="https://example.com/dsgvo">Datenschutzerklärung</a>)
assert html =~ "Akzeptiere die"
end
end
describe "join field input types" do