tests: add tests

This commit is contained in:
carla 2026-02-09 13:34:57 +01:00
parent e1266944b1
commit 9115d53198
6 changed files with 503 additions and 649 deletions

View file

@ -199,22 +199,6 @@ defmodule Mv.Membership.MembersCSVTest do
assert csv =~ "M,m@m.com,Paid"
end
test "computed column with payment_status key exports same value (alias)" do
columns = [
%{header: "First Name", kind: :member_field, key: "first_name"},
%{header: "Membership Fee Status", kind: :computed, key: :payment_status}
]
member = %{first_name: "X", payment_status: "Unpaid"}
iodata = MembersCSV.export([member], columns)
csv = IO.iodata_to_binary(iodata)
assert csv =~ "Membership Fee Status"
assert csv =~ "Unpaid"
assert csv =~ "X,Unpaid"
end
test "CSV injection: formula-like and dangerous prefixes are escaped with apostrophe" do
member = %{
first_name: "=SUM(A1:A10)",