Extend Last.fm Feed album/artist functions

This commit is contained in:
Claudio Ortolina
2025-03-10 17:41:17 +00:00
parent 3063155349
commit ec10447ca0
2 changed files with 24 additions and 8 deletions
+18 -2
View File
@@ -49,12 +49,28 @@ defmodule LastFm.FeedTest do
test "it returns artists in descending order of scrobble" do
:ok = Feed.update([@track_two, @track_one])
assert [@track_one.artist] == Feed.all_artists()
assert [
%{
artist: @track_two.artist,
scrobbled_at_uts: @track_two.scrobbled_at_uts,
scrobbled_at_label: @track_two.scrobbled_at_label
}
] ==
Feed.all_artists()
end
test "it returns albums in descending order of scrobble" do
:ok = Feed.update([@track_two, @track_one])
assert [@track_one.album] == Feed.all_albums()
assert [
%{
album: @track_two.album,
cover_url: @track_two.cover_url,
scrobbled_at_uts: @track_two.scrobbled_at_uts,
scrobbled_at_label: @track_two.scrobbled_at_label
}
] == Feed.all_albums()
end
end
end