Merge branch 'main' into feat/299_plz
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
carla 2026-02-24 11:44:19 +01:00
commit 9a7608f9a1
16 changed files with 573 additions and 88 deletions

View file

@ -199,6 +199,43 @@ defmodule Mv.Membership.MembersCSVTest do
assert csv =~ "M,m@m.com,Paid"
end
test "membership_fee_type column exports fee type name" do
columns = [
%{header: "First Name", kind: :member_field, key: "first_name"},
%{header: "Email", kind: :member_field, key: "email"},
%{header: "Fee Type", kind: :membership_fee_type, key: :membership_fee_type}
]
member = %{
first_name: "M",
email: "m@m.com",
membership_fee_type: %{id: "ft-1", name: "Standard"}
}
iodata = MembersCSV.export([member], columns)
csv = IO.iodata_to_binary(iodata)
assert csv =~ "Fee Type"
assert csv =~ "Standard"
assert csv =~ "M,m@m.com,Standard"
end
test "membership_fee_type column exports empty when no fee type" do
columns = [
%{header: "First Name", kind: :member_field, key: "first_name"},
%{header: "Fee Type", kind: :membership_fee_type, key: :membership_fee_type}
]
member = %{first_name: "M", email: "m@m.com", membership_fee_type: nil}
iodata = MembersCSV.export([member], columns)
csv = IO.iodata_to_binary(iodata)
assert csv =~ "Fee Type"
assert csv =~ "M,"
refute csv =~ "Standard"
end
test "CSV injection: formula-like and dangerous prefixes are escaped with apostrophe" do
member = %{
first_name: "=SUM(A1:A10)",