Add an action to add author to relative author's alias registry.

This commit is contained in:
2025-03-07 14:15:27 +02:00
parent f2f4990779
commit ef7d1ed057
3 changed files with 35 additions and 7 deletions
@@ -14,5 +14,19 @@ defmodule DecentralisedBookIndex.Metadata.AuthorTest do
assert {:ok, author} = Metadata.create_author("Author", "An description", registry.id)
assert author.author_alias_registry_id == registry.id
end
test "a new author to a registry via a related author record" do
{:ok, related_author} = Metadata.create_author("Author", "An description")
assert {:ok, author} =
Metadata.add_author_to_related_alias_registry("Author2", "An description2", related_author.id)
assert related_author.author_alias_registry_id == author.author_alias_registry_id
end
test "a new author to a registry via a empty related author record" do
assert {:error, _} =
Metadata.add_author_to_related_alias_registry("Author2", "An description2", nil)
end
end
end