add forgotten files

This commit is contained in:
Your Name
2025-09-16 09:34:03 +00:00
parent 12ce7d1d5d
commit c6e3a490d2
3 changed files with 92 additions and 0 deletions
@@ -0,0 +1,40 @@
defmodule FunCore.BasicSignupAllowlistTest do
use ExUnit.Case
import FunCore.BasicSignupAllowlist
test "addresses_as_list" do
assert addresses_as_list("joe@example.com, jane@example.com") == [
"joe@example.com",
"jane@example.com"
]
end
test "jane in list" do
lst = addresses_as_list("joe@example.com, jane@example.com")
assert "jane@example.com" in lst
end
describe "Not allowlisted when allowed list is" do
test "not set" do
refute(mail_allowlisted_fun(nil, "joe@example.com"))
end
test "empty" do
refute(mail_allowlisted_fun("j", "joe@example.com"))
end
end
describe "Allowlisted when" do
test "*" do
assert(mail_allowlisted_fun("*", "jane@example.com"))
end
test "Multiple set and one match" do
assert(mail_allowlisted_fun("joe@example.com, jane@example.com", "jane@example.com"))
end
test "Matches with different casings" do
assert(mail_allowlisted_fun("joe@Example.com, jane@example.com", "Joe@example.com"))
end
end
end