Seeds split, Credo strict, and member/settings UI polish #458

Merged
moritz merged 18 commits from feat/seeds into main 2026-03-04 20:19:51 +01:00
Showing only changes of commit 6987733707 - Show all commits

View file

@ -8,7 +8,9 @@ defmodule Mv.Membership.MembersPDFTest do
- Generates valid PDF binary (starts with "%PDF") - Generates valid PDF binary (starts with "%PDF")
- Handles errors gracefully - Handles errors gracefully
""" """
use ExUnit.Case, async: true # async: false so tests that manipulate the template file (e.g. "returns error when template file is missing")
# do not run in parallel and cannot leave the template removed on failure
use ExUnit.Case, async: false
alias Mv.Config alias Mv.Config
alias Mv.Membership.MembersPDF alias Mv.Membership.MembersPDF
@ -162,13 +164,13 @@ defmodule Mv.Membership.MembersPDFTest do
end end
test "returns error when template file is missing" do test "returns error when template file is missing" do
# Temporarily rename template to simulate missing file
template_path = template_path =
Path.join(Application.app_dir(:mv, "priv"), "pdf_templates/members_export.typ") Path.join(Application.app_dir(:mv, "priv"), "pdf_templates/members_export.typ")
original_content = File.read!(template_path) original_content = File.read!(template_path)
File.rm(template_path) File.rm(template_path)
try do
export_data = %{ export_data = %{
columns: [%{key: "first_name", kind: :member_field, label: "Vorname"}], columns: [%{key: "first_name", kind: :member_field, label: "Vorname"}],
rows: [["Max"]], rows: [["Max"]],
@ -178,10 +180,10 @@ defmodule Mv.Membership.MembersPDFTest do
result = MembersPDF.render(export_data) result = MembersPDF.render(export_data)
assert {:error, {:template_not_found, _reason}} = result assert {:error, {:template_not_found, _reason}} = result
after
# Restore template
File.write!(template_path, original_content) File.write!(template_path, original_content)
end end
end
test "handles empty rows gracefully" do test "handles empty rows gracefully" do
export_data = %{ export_data = %{