From a6319d55dfeaf7ee753f30b217ef5b772f747b99 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Mon, 20 Apr 2026 06:31:33 +0100 Subject: [PATCH] Pin artist_live/show image_data_hash assertions Refs #176 --- test/music_library_web/live/artist_live/show_test.exs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/music_library_web/live/artist_live/show_test.exs b/test/music_library_web/live/artist_live/show_test.exs index 55ae647a..94a310d5 100644 --- a/test/music_library_web/live/artist_live/show_test.exs +++ b/test/music_library_web/live/artist_live/show_test.exs @@ -6,6 +6,8 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do alias LastFm.Fixtures alias MusicLibrary.Artists + alias MusicLibrary.Assets + alias MusicLibrary.Assets.Asset defp fill_collection(_config) do collection_record = @@ -229,7 +231,9 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do updated = Artists.get_artist_info!(artist_info.id) assert updated.image_data_hash != artist_info.image_data_hash - assert updated.image_data_hash != nil + hash = updated.image_data_hash + assert is_binary(hash) and byte_size(hash) > 0 + assert %Asset{hash: ^hash} = Assets.get(hash) end test "selecting a Brave Search result downloads and saves the image", %{ @@ -264,7 +268,9 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do updated = Artists.get_artist_info!(artist_info.id) assert updated.image_data_hash != artist_info.image_data_hash - assert updated.image_data_hash != nil + hash = updated.image_data_hash + assert is_binary(hash) and byte_size(hash) > 0 + assert %Asset{hash: ^hash} = Assets.get(hash) end end