Can fetch records by a specific artist

This commit is contained in:
Claudio Ortolina
2024-12-02 10:20:47 +00:00
parent 963b3c826f
commit b63b3a633a
4 changed files with 79 additions and 1 deletions
+23
View File
@@ -156,6 +156,29 @@ defmodule MusicLibrary.RecordsTest do
end
end
describe "get_artists_records/1" do
test "it returns records with essential data" do
expected = record_fixture()
artist_musicbrainz_id = expected.artists |> hd() |> Map.get(:musicbrainz_id)
[artist_record] = Records.get_artist_records(artist_musicbrainz_id)
assert expected.id == artist_record.id
end
end
describe "get_artist/1" do
test "it returns records with essential data" do
record = record_fixture()
expected = record.artists |> hd()
artist = Records.get_artist(expected.musicbrainz_id)
assert expected == artist
end
end
describe "get_cover/1" do
test "it returns the record cover by id" do
# while this test may seem redundant, it implicitely checks that ALL record fields are returned,