fix: failing tests
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/promote/production Build is failing

This commit is contained in:
Simon 2026-03-13 19:43:04 +01:00
parent a4239ce09b
commit 86c032004e
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
2 changed files with 4 additions and 7 deletions

View file

@ -56,13 +56,6 @@ defmodule Mv.Membership.SettingJoinFormTest do
Membership.update_settings(settings, attrs) Membership.update_settings(settings, attrs)
end end
defp _error_message(errors, field) when is_atom(field) do
errors
|> Enum.filter(fn err -> Map.get(err, :field) == field end)
|> Enum.map(&Map.get(&1, :message, ""))
|> List.first() || ""
end
# ---- 1. Persistence and loading ---- # ---- 1. Persistence and loading ----
describe "join form settings persistence and loading" do describe "join form settings persistence and loading" do

View file

@ -14,6 +14,7 @@ defmodule MvWeb.JoinLiveTest do
import Phoenix.LiveViewTest import Phoenix.LiveViewTest
import Ecto.Query import Ecto.Query
alias Ecto.Adapters.SQL.Sandbox
alias Mv.Membership alias Mv.Membership
alias Mv.Repo alias Mv.Repo
@ -45,6 +46,9 @@ defmodule MvWeb.JoinLiveTest do
count_before = count_join_requests() count_before = count_join_requests()
{:ok, view, _html} = live(conn, "/join") {:ok, view, _html} = live(conn, "/join")
# Allow LiveView process to use the same Ecto sandbox so the test sees the created JoinRequest.
Sandbox.allow(Repo, conn.private[:ecto_sandbox], view.pid)
view view
|> form("#join-form", %{ |> form("#join-form", %{
"email" => "newuser#{System.unique_integer([:positive])}@example.com", "email" => "newuser#{System.unique_integer([:positive])}@example.com",