Add the action to get author's books.
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-13 17:41:14 +02:00
parent 70542781c2
commit c546c61268
3 changed files with 26 additions and 0 deletions
@@ -59,4 +59,18 @@ defmodule DecentralisedBookIndex.Metadata.BookTest do
assert alternatives_names = [related_book]
end
end
describe "author's books" do
test "get the list via author's id" do
{:ok, author} = Metadata.create_author("Author", "An description")
author_roles = [
%{order: 1, author_id: author.id, role: ""}
]
{:ok, book} = Metadata.create_book("Book", "1234567890", "An description", author_roles)
assert {:ok, books} = Metadata.get_author_books(author)
end
end
end