diff --git a/after b/after new file mode 100644 index 00000000..41c469af --- /dev/null +++ b/after @@ -0,0 +1,152 @@ +Compiling 1 file (.ex) +Generated music_library app + +11:30:46.549 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib` + +11:30:46.549 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib` +Running ExUnit with seed: 648807, max_cases: 1 + + +MusicLibrary.Records.SearchParserTest [test/music_library/records/search_parser_test.exs] + * doctest MusicLibrary.Records.SearchParser.parse/1 (1) [L#4] * doctest MusicLibrary.Records.SearchParser.parse/1 (1) (12.6ms) [L#4] + +MusicLibrary.Records.CoverTest [test/music_library/records/cover_test.exs] + * test resize/1 it resizes to the desired size [L#7] * test resize/1 it resizes to the desired size (98.1ms) [L#7] + +LastFm.ConfigTest [test/last_fm/config_test.exs] + * test resolve/1 reads data from application configuration [L#5] * test resolve/1 reads data from application configuration (0.01ms) [L#5] + +MusicLibraryWeb.ErrorJSONTest [test/music_library_web/controllers/error_json_test.exs] + * test renders 500 [L#8] * test renders 500 (9.8ms) [L#8] + * test renders 404 [L#4] * test renders 404 (0.1ms) [L#4] + +LastFm.FeedTest [test/last_fm/feed_test.exs] + * test update and broadcast it returns tracks in descending order of scrobble [L#45] * test update and broadcast it returns tracks in descending order of scrobble (0.02ms) [L#45] + * test update and broadcast it returns artists in descending order of scrobble [L#50] * test update and broadcast it returns artists in descending order of scrobble (0.01ms) [L#50] + * test update and broadcast it returns albums in descending order of scrobble [L#55] * test update and broadcast it returns albums in descending order of scrobble (0.01ms) [L#55] + * test update and broadcast it stores the track and broadcasts the update [L#38] * test update and broadcast it stores the track and broadcasts the update (0.01ms) [L#38] + +MusicLibraryWeb.AuthTest [test/music_library_web/plug/auth_test.exs] + * test require_logged_in/2 when logged in, it passes through [L#33] * test require_logged_in/2 when logged in, it passes through (0.8ms) [L#33] + * test require_logged_in/2 when logged out, it redirects to /login [L#19] * test require_logged_in/2 when logged out, it redirects to /login (2.4ms) [L#19] + +Obsidian.ParserTest [test/obsidian/parser_test.exs] + * test handles special characters in titles [L#32] * test handles special characters in titles (7.0ms) [L#32] + * test parses the content of the Obsidian album entry [L#8] * test parses the content of the Obsidian album entry (0.4ms) [L#8] + +LastFm.ArtistTest [test/last_fm/artist_test.exs] + * test from_api_response/1 returns correct data [L#7] * test from_api_response/1 returns correct data (2.2ms) [L#7] + +LastFm.TrackTest [test/last_fm/track_test.exs] + * test from_api_response/1 returns correct data [L#7] * test from_api_response/1 returns correct data (0.2ms) [L#7] + +MusicLibraryWeb.ErrorHTMLTest [test/music_library_web/controllers/error_html_test.exs] + * test renders 500.html [L#11] * test renders 500.html (1.5ms) [L#11] + * test renders 404.html [L#7] * test renders 404.html (0.1ms) [L#7] + +MusicLibraryWeb.WishlistLive.IndexTest [test/music_library_web/live/wishlist_live/index_test.exs] + * test Wishlist can purchase a record and move it to the collection [L#14] * test Wishlist can purchase a record and move it to the collection (107.1ms) [L#14] + +MusicLibraryWeb.SessionControllerTest [test/music_library_web/controllers/session_controller_test.exs] + * test GET /login it resets the session [L#15] * test GET /login it resets the session (2.1ms) [L#15] + * test POST /sessions/create it refuses an invalid password [L#26] * test POST /sessions/create it refuses an invalid password (0.1ms) [L#26] + * test POST /sessions/create it accepts a valid password [L#42] * test POST /sessions/create it accepts a valid password (0.1ms) [L#42] + * test GET /login it shows the login form [L#6] * test GET /login it shows the login form (0.9ms) [L#6] + +MusicLibrary.CollectionTest [test/music_library/collection_test.exs] + * test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records [L#84] * test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records (3.2ms) [L#84] + * test get_latest_record!/0 returns the most recently purchased record [L#92] * test get_latest_record!/0 returns the most recently purchased record (2.7ms) [L#92] + * test search_records/2 it respects limit [L#46] * test search_records/2 it respects limit (2.3ms) [L#46] + * test search_records/2 it respects offset [L#50] * test search_records/2 it respects offset (2.5ms) [L#50] + * test get_random_record!/0 returns a random record [L#103] * test get_random_record!/0 returns a random record (2.3ms) [L#103] + * test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records [L#76] * test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records (2.3ms) [L#76] + * test search_records/2 it respects order [L#56] * test search_records/2 it respects order (2.3ms) [L#56] + * test search_records_count/1 returns the count of matching records, excluding wishlisted records [L#68] * test search_records_count/1 returns the count of matching records, excluding wishlisted records (2.2ms) [L#68] + * test search_records/2 returns matching records, excluding wishlisted records [L#41] * test search_records/2 returns matching records, excluding wishlisted records (2.3ms) [L#41] + +MusicLibraryWeb.CollectionControllerTest [test/music_library_web/controllers/collection_controller_test.exs] + * test GET /api/collection/latest it returns the latest record [L#24] * test GET /api/collection/latest it returns the latest record (2.1ms) [L#24] + * test GET /api/collection/random it requires authentication [L#44] * test GET /api/collection/random it requires authentication (0.7ms) [L#44] + * test GET /api/collection/random it returns a random record [L#51] * test GET /api/collection/random it returns a random record (0.9ms) [L#51] + * test GET /api/collection/latest it requires authentication [L#18] * test GET /api/collection/latest it requires authentication (0.6ms) [L#18] + +MusicLibraryWeb.StatsLive.IndexTest [test/music_library_web/live/stats_live/index_test.exs] + * test Stats home page it shows the latest purchase [L#56] * test Stats home page it shows the latest purchase (31.6ms) [L#56] + * test Stats home page it shows the wishlist total count [L#71] * test Stats home page it shows the wishlist total count (26.8ms) [L#71] + * test Stats home page it shows the scrobble activity [L#77] * test Stats home page it shows the scrobble activity (73.7ms) [L#77] + * test Stats home page it shows the collection counts (total, format, and type) [L#32] * test Stats home page it shows the collection counts (total, format, and type) (49.3ms) [L#32] + +MusicLibrary.WishlistTest [test/music_library/wishlist_test.exs] + * test search_records/2 it respects limit [L#25] * test search_records/2 it respects limit (2.6ms) [L#25] + * test search_records/2 it respects offset [L#29] * test search_records/2 it respects offset (2.2ms) [L#29] + * test search_records_count/1 returns the count of matching records, excluding purchased records [L#39] * test search_records_count/1 returns the count of matching records, excluding purchased records (2.3ms) [L#39] + * test count/0 returns the count of records in the wishlist, excluding purchased records [L#47] * test count/0 returns the count of records in the wishlist, excluding purchased records (2.0ms) [L#47] + * test search_records/2 returns matching records, excluding purchased records [L#21] * test search_records/2 returns matching records, excluding purchased records (2.2ms) [L#21] + +MusicLibraryWeb.CoverControllerTest [test/music_library_web/controllers/cover_controller_test.exs] + * test GET /covers/:record_id serves the cover without etag [L#21] * test GET /covers/:record_id serves the cover without etag (1.7ms) [L#21] + * test GET /covers/:record_id serves the cover when etag doesn't match [L#32] * test GET /covers/:record_id serves the cover when etag doesn't match (0.8ms) [L#32] + * test GET /covers/:record_id serves a 304 when etag matches [L#46] * test GET /covers/:record_id serves a 304 when etag matches (0.8ms) [L#46] + * test GET /covers/:record_id accepts a size attribute for resizing [L#60] * test GET /covers/:record_id accepts a size attribute for resizing (3.8ms) [L#60] + * test GET /covers/:record_id 404s when record doesn't exist [L#14] * test GET /covers/:record_id 404s when record doesn't exist (0.8ms) [L#14] + +MusicLibrary.RepoTest [test/music_library/repo_test.exs] + * test correctly loads the unicode extension unaccent function [L#5] * test correctly loads the unicode extension unaccent function (0.1ms) [L#5] + +MusicLibrary.ArtistsTest [test/music_library/artists_test.exs] + * test get_artist/1 it returns records with essential data [L#8] * test get_artist/1 it returns records with essential data (0.7ms) [L#8] + +MusicLibrary.RecordsTest [test/music_library/records_test.exs] + * test search_records/2 tagged search - type [L#101] * test search_records/2 tagged search - type (2.7ms) [L#101] + * test search_records/2 tagged search - mbid [L#105] * test search_records/2 tagged search - mbid (3.0ms) [L#105] + * test refresh_musicbrainz_data/1 updates release_ids and included_release_group_ids [L#54] * test refresh_musicbrainz_data/1 updates release_ids and included_release_group_ids (1.1ms) [L#54] + * test get_record!/1 it fetches the record by id [L#150] * test get_record!/1 it fetches the record by id (0.9ms) [L#150] + * test search_records/2 untagged search (with limit and offset) [L#80] * test search_records/2 untagged search (with limit and offset) (2.9ms) [L#80] + * test get_artists_records/1 it returns records with essential data [L#160] * test get_artists_records/1 it returns records with essential data (0.7ms) [L#160] + * test search_records_count/2 untagged search [L#117] * test search_records_count/2 untagged search (2.5ms) [L#117] + * test refresh cover/1 it fetches and stores the updated cover [L#296] * test refresh cover/1 it fetches and stores the updated cover (4.8ms) [L#296] + * test search_records/2 tagged search - format [L#97] * test search_records/2 tagged search - format (2.7ms) [L#97] + * test import_from_musicbrainz_release/2 it saves a record with its cover art [L#243] * test import_from_musicbrainz_release/2 it saves a record with its cover art (4.4ms) [L#243] + * test search_records_count/2 tagged search - format [L#130] * test search_records_count/2 tagged search - format (2.7ms) [L#130] + * test search_records_count/2 tagged search - artist [L#125] * test search_records_count/2 tagged search - artist (2.8ms) [L#125] + * test search_records_count/2 tagged search - type [L#134] * test search_records_count/2 tagged search - type (2.5ms) [L#134] + * test import_from_musicbrainz_release_group/2 it saves a record with its cover art [L#197] * test import_from_musicbrainz_release_group/2 it saves a record with its cover art (4.2ms) [L#197] + * test search_records_count/2 tagged search - album [L#121] * test search_records_count/2 tagged search - album (2.7ms) [L#121] + * test search_records/2 tagged search - album [L#88] * test search_records/2 tagged search - album (2.5ms) [L#88] + * test search_records/2 tagged search - artist [L#92] * test search_records/2 tagged search - artist (2.8ms) [L#92] + * test create_record/1 populates computed values [L#35] * test create_record/1 populates computed values (0.5ms) [L#35] + * test get_cover/1 it returns the record cover by id [L#172] * test get_cover/1 it returns the record cover by id (0.6ms) [L#172] + * test search_records_count/2 tagged search - mbid [L#138] * test search_records_count/2 tagged search - mbid (2.6ms) [L#138] + * test search_release_group/2 it returns results with correct limit and offset [L#182] * test search_release_group/2 it returns results with correct limit and offset (0.08ms) [L#182] + +MusicLibraryWeb.CollectionLive.ShowTest [test/music_library_web/live/collection_live/show_test.exs] + * test Show record it includes all needed information [L#31] * test Show record it includes all needed information (18.5ms) [L#31] + * test Edit record from show page can navigate to the record edit form [L#19] * test Edit record from show page can navigate to the record edit form (16.2ms) [L#19] + +MusicLibraryWeb.ArtistLive.ShowTest [test/music_library_web/live/artist_live/show_test.exs] + * test Show artist it gracefully handles errors in fetching bio and play count [L#54] * test Show artist it gracefully handles errors in fetching bio and play count (7.5ms) [L#54] + * test Show artist it shows records from the collection and the wishlist [L#72] * test Show artist it shows records from the collection and the wishlist (5.2ms) [L#72] + * test Show artist it shows the artist bio and play count [L#34] * test Show artist it shows the artist bio and play count (5.5ms) [L#34] + +MusicLibraryWeb.CollectionLive.IndexTest [test/music_library_web/live/collection_live/index_test.exs] + * test Updating record metadata can change the record cover [L#227] * test Updating record metadata can change the record cover (40.1ms) [L#227] + * test Importing a new record it shows the import modal [L#259] * test Importing a new record it shows the import modal (4.8ms) [L#259] + * test Collection shows purchased records (first page only) [L#50] * test Collection shows purchased records (first page only) (485.0ms) [L#50] + * test Search and pagination uses query string params [L#92] * test Search and pagination uses query string params (76.6ms) [L#92] + * test Importing a new record it imports a record when selected [L#268] * test Importing a new record it imports a record when selected (25.2ms) [L#268] + * test Updating record metadata can navigate to the record edit form [L#217] * test Updating record metadata can navigate to the record edit form (5.6ms) [L#217] + * test Tagged search supports raw queries [L#143] * test Tagged search supports raw queries (27.6ms) [L#143] + * test Tagged search supports filters [L#168] * test Tagged search supports filters (163.5ms) [L#168] + * test Collection does not show wishlist records [L#39] * test Collection does not show wishlist records (172.8ms) [L#39] + +Finished in 1.6 seconds (0.2s async, 1.4s sync) + +Top 5 slowest (1.0s), 60.4% of total time: + + * test Collection shows purchased records (first page only) (MusicLibraryWeb.CollectionLive.IndexTest) (485.0ms) [test/music_library_web/live/collection_live/index_test.exs:50] + * test Collection does not show wishlist records (MusicLibraryWeb.CollectionLive.IndexTest) (172.8ms) [test/music_library_web/live/collection_live/index_test.exs:39] + * test Tagged search supports filters (MusicLibraryWeb.CollectionLive.IndexTest) (163.5ms) [test/music_library_web/live/collection_live/index_test.exs:168] + * test Wishlist can purchase a record and move it to the collection (MusicLibraryWeb.WishlistLive.IndexTest) (107.1ms) [test/music_library_web/live/wishlist_live/index_test.exs:14] + * test resize/1 it resizes to the desired size (MusicLibrary.Records.CoverTest) (98.1ms) [test/music_library/records/cover_test.exs:7] + +1 doctest, 85 tests, 0 failures diff --git a/before b/before new file mode 100644 index 00000000..8a262acc --- /dev/null +++ b/before @@ -0,0 +1,151 @@ +Generated music_library app + +11:30:38.529 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib` + +11:30:38.529 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib` +Running ExUnit with seed: 637247, max_cases: 1 + + +MusicLibraryWeb.ErrorHTMLTest [test/music_library_web/controllers/error_html_test.exs] + * test renders 404.html [L#7] * test renders 404.html (46.2ms) [L#7] + * test renders 500.html [L#11] * test renders 500.html (0.2ms) [L#11] + +MusicLibraryWeb.ErrorJSONTest [test/music_library_web/controllers/error_json_test.exs] + * test renders 404 [L#4] * test renders 404 (5.5ms) [L#4] + * test renders 500 [L#8] * test renders 500 (0.2ms) [L#8] + +LastFm.FeedTest [test/last_fm/feed_test.exs] + * test update and broadcast it returns artists in descending order of scrobble [L#50] * test update and broadcast it returns artists in descending order of scrobble (0.06ms) [L#50] + * test update and broadcast it stores the track and broadcasts the update [L#38] * test update and broadcast it stores the track and broadcasts the update (0.02ms) [L#38] + * test update and broadcast it returns albums in descending order of scrobble [L#55] * test update and broadcast it returns albums in descending order of scrobble (0.01ms) [L#55] + * test update and broadcast it returns tracks in descending order of scrobble [L#45] * test update and broadcast it returns tracks in descending order of scrobble (0.02ms) [L#45] + +MusicLibrary.Records.SearchParserTest [test/music_library/records/search_parser_test.exs] + * doctest MusicLibrary.Records.SearchParser.parse/1 (1) [L#4] * doctest MusicLibrary.Records.SearchParser.parse/1 (1) (11.3ms) [L#4] + +LastFm.ArtistTest [test/last_fm/artist_test.exs] + * test from_api_response/1 returns correct data [L#7] * test from_api_response/1 returns correct data (12.9ms) [L#7] + +Obsidian.ParserTest [test/obsidian/parser_test.exs] + * test parses the content of the Obsidian album entry [L#8] * test parses the content of the Obsidian album entry (24.2ms) [L#8] + * test handles special characters in titles [L#32] * test handles special characters in titles (1.0ms) [L#32] + +MusicLibraryWeb.AuthTest [test/music_library_web/plug/auth_test.exs] + * test require_logged_in/2 when logged out, it redirects to /login [L#19] * test require_logged_in/2 when logged out, it redirects to /login (4.9ms) [L#19] + * test require_logged_in/2 when logged in, it passes through [L#33] * test require_logged_in/2 when logged in, it passes through (0.01ms) [L#33] + +MusicLibrary.Records.CoverTest [test/music_library/records/cover_test.exs] + * test resize/1 it resizes to the desired size [L#7] * test resize/1 it resizes to the desired size (56.7ms) [L#7] + +LastFm.ConfigTest [test/last_fm/config_test.exs] + * test resolve/1 reads data from application configuration [L#5] * test resolve/1 reads data from application configuration (0.01ms) [L#5] + +LastFm.TrackTest [test/last_fm/track_test.exs] + * test from_api_response/1 returns correct data [L#7] * test from_api_response/1 returns correct data (0.7ms) [L#7] + +MusicLibrary.WishlistTest [test/music_library/wishlist_test.exs] + * test search_records/2 it respects offset [L#29] * test search_records/2 it respects offset (26.1ms) [L#29] + * test search_records/2 returns matching records, excluding purchased records [L#21] * test search_records/2 returns matching records, excluding purchased records (2.5ms) [L#21] + * test count/0 returns the count of records in the wishlist, excluding purchased records [L#47] * test count/0 returns the count of records in the wishlist, excluding purchased records (2.1ms) [L#47] + * test search_records_count/1 returns the count of matching records, excluding purchased records [L#39] * test search_records_count/1 returns the count of matching records, excluding purchased records (2.9ms) [L#39] + * test search_records/2 it respects limit [L#25] * test search_records/2 it respects limit (2.5ms) [L#25] + +MusicLibrary.CollectionTest [test/music_library/collection_test.exs] + * test search_records/2 it respects offset [L#50] * test search_records/2 it respects offset (4.6ms) [L#50] + * test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records [L#76] * test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records (2.3ms) [L#76] + * test get_random_record!/0 returns a random record [L#103] * test get_random_record!/0 returns a random record (2.2ms) [L#103] + * test get_latest_record!/0 returns the most recently purchased record [L#92] * test get_latest_record!/0 returns the most recently purchased record (2.9ms) [L#92] + * test search_records/2 returns matching records, excluding wishlisted records [L#41] * test search_records/2 returns matching records, excluding wishlisted records (2.9ms) [L#41] + * test search_records_count/1 returns the count of matching records, excluding wishlisted records [L#68] * test search_records_count/1 returns the count of matching records, excluding wishlisted records (2.7ms) [L#68] + * test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records [L#84] * test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records (2.3ms) [L#84] + * test search_records/2 it respects order [L#56] * test search_records/2 it respects order (2.5ms) [L#56] + * test search_records/2 it respects limit [L#46] * test search_records/2 it respects limit (2.3ms) [L#46] + +MusicLibraryWeb.WishlistLive.IndexTest [test/music_library_web/live/wishlist_live/index_test.exs] + * test Wishlist can purchase a record and move it to the collection [L#15] * test Wishlist can purchase a record and move it to the collection (82.7ms) [L#15] + +MusicLibraryWeb.CollectionLive.ShowTest [test/music_library_web/live/collection_live/show_test.exs] + * test Edit record from show page can navigate to the record edit form [L#19] * test Edit record from show page can navigate to the record edit form (16.6ms) [L#19] + * test Show record it includes all needed information [L#33] * test Show record it includes all needed information (7.1ms) [L#33] + +MusicLibrary.RepoTest [test/music_library/repo_test.exs] + * test correctly loads the unicode extension unaccent function [L#5] * test correctly loads the unicode extension unaccent function (0.1ms) [L#5] + +MusicLibraryWeb.StatsLive.IndexTest [test/music_library_web/live/stats_live/index_test.exs] + * test Stats home page it shows the wishlist total count [L#70] * test Stats home page it shows the wishlist total count (31.0ms) [L#70] + * test Stats home page it shows the collection counts (total, format, and type) [L#33] * test Stats home page it shows the collection counts (total, format, and type) (26.5ms) [L#33] + * test Stats home page it shows the scrobble activity [L#76] * test Stats home page it shows the scrobble activity (36.5ms) [L#76] + * test Stats home page it shows the latest purchase [L#56] * test Stats home page it shows the latest purchase (24.6ms) [L#56] + +MusicLibrary.ArtistsTest [test/music_library/artists_test.exs] + * test get_artist/1 it returns records with essential data [L#8] * test get_artist/1 it returns records with essential data (0.8ms) [L#8] + +MusicLibraryWeb.CoverControllerTest [test/music_library_web/controllers/cover_controller_test.exs] + * test GET /covers/:record_id serves the cover when etag doesn't match [L#32] * test GET /covers/:record_id serves the cover when etag doesn't match (1.6ms) [L#32] + * test GET /covers/:record_id 404s when record doesn't exist [L#14] * test GET /covers/:record_id 404s when record doesn't exist (1.6ms) [L#14] + * test GET /covers/:record_id accepts a size attribute for resizing [L#60] * test GET /covers/:record_id accepts a size attribute for resizing (4.2ms) [L#60] + * test GET /covers/:record_id serves a 304 when etag matches [L#46] * test GET /covers/:record_id serves a 304 when etag matches (0.8ms) [L#46] + * test GET /covers/:record_id serves the cover without etag [L#21] * test GET /covers/:record_id serves the cover without etag (0.7ms) [L#21] + +MusicLibraryWeb.SessionControllerTest [test/music_library_web/controllers/session_controller_test.exs] + * test POST /sessions/create it refuses an invalid password [L#26] * test POST /sessions/create it refuses an invalid password (0.8ms) [L#26] + * test GET /login it shows the login form [L#6] * test GET /login it shows the login form (0.9ms) [L#6] + * test POST /sessions/create it accepts a valid password [L#42] * test POST /sessions/create it accepts a valid password (0.2ms) [L#42] + * test GET /login it resets the session [L#15] * test GET /login it resets the session (0.2ms) [L#15] + +MusicLibraryWeb.ArtistLive.ShowTest [test/music_library_web/live/artist_live/show_test.exs] + * test Show artist it shows records from the collection and the wishlist [L#79] * test Show artist it shows records from the collection and the wishlist (7.3ms) [L#79] + * test Show artist it shows the artist bio and play count [L#34] * test Show artist it shows the artist bio and play count (4.5ms) [L#34] + * test Show artist it gracefully handles errors in fetching bio and play count [L#58] * test Show artist it gracefully handles errors in fetching bio and play count (3.0ms) [L#58] + +MusicLibrary.RecordsTest [test/music_library/records_test.exs] + * test search_records_count/2 tagged search - artist [L#125] * test search_records_count/2 tagged search - artist (2.9ms) [L#125] + * test import_from_musicbrainz_release/2 it saves a record with its cover art [L#243] * test import_from_musicbrainz_release/2 it saves a record with its cover art (4.7ms) [L#243] + * test import_from_musicbrainz_release_group/2 it saves a record with its cover art [L#197] * test import_from_musicbrainz_release_group/2 it saves a record with its cover art (4.2ms) [L#197] + * test search_records_count/2 tagged search - mbid [L#138] * test search_records_count/2 tagged search - mbid (2.7ms) [L#138] + * test search_records/2 untagged search (with limit and offset) [L#80] * test search_records/2 untagged search (with limit and offset) (3.0ms) [L#80] + * test search_records/2 tagged search - format [L#97] * test search_records/2 tagged search - format (2.7ms) [L#97] + * test search_records_count/2 untagged search [L#117] * test search_records_count/2 untagged search (2.5ms) [L#117] + * test get_record!/1 it fetches the record by id [L#150] * test get_record!/1 it fetches the record by id (0.8ms) [L#150] + * test refresh cover/1 it fetches and stores the updated cover [L#296] * test refresh cover/1 it fetches and stores the updated cover (5.1ms) [L#296] + * test search_records/2 tagged search - mbid [L#105] * test search_records/2 tagged search - mbid (3.0ms) [L#105] + * test search_records_count/2 tagged search - album [L#121] * test search_records_count/2 tagged search - album (2.4ms) [L#121] + * test search_records_count/2 tagged search - type [L#134] * test search_records_count/2 tagged search - type (2.5ms) [L#134] + * test search_release_group/2 it returns results with correct limit and offset [L#182] * test search_release_group/2 it returns results with correct limit and offset (0.1ms) [L#182] + * test create_record/1 populates computed values [L#35] * test create_record/1 populates computed values (0.8ms) [L#35] + * test get_artists_records/1 it returns records with essential data [L#160] * test get_artists_records/1 it returns records with essential data (0.8ms) [L#160] + * test search_records/2 tagged search - artist [L#92] * test search_records/2 tagged search - artist (2.8ms) [L#92] + * test get_cover/1 it returns the record cover by id [L#172] * test get_cover/1 it returns the record cover by id (0.6ms) [L#172] + * test search_records/2 tagged search - type [L#101] * test search_records/2 tagged search - type (2.5ms) [L#101] + * test search_records_count/2 tagged search - format [L#130] * test search_records_count/2 tagged search - format (2.6ms) [L#130] + * test search_records/2 tagged search - album [L#88] * test search_records/2 tagged search - album (2.5ms) [L#88] + * test refresh_musicbrainz_data/1 updates release_ids and included_release_group_ids [L#54] * test refresh_musicbrainz_data/1 updates release_ids and included_release_group_ids (1.0ms) [L#54] + +MusicLibraryWeb.CollectionControllerTest [test/music_library_web/controllers/collection_controller_test.exs] + * test GET /api/collection/random it requires authentication [L#44] * test GET /api/collection/random it requires authentication (0.6ms) [L#44] + * test GET /api/collection/latest it requires authentication [L#18] * test GET /api/collection/latest it requires authentication (0.5ms) [L#18] + * test GET /api/collection/random it returns a random record [L#51] * test GET /api/collection/random it returns a random record (2.2ms) [L#51] + * test GET /api/collection/latest it returns the latest record [L#24] * test GET /api/collection/latest it returns the latest record (0.8ms) [L#24] + +MusicLibraryWeb.CollectionLive.IndexTest [test/music_library_web/live/collection_live/index_test.exs] + * test Search and pagination uses query string params [L#84] * test Search and pagination uses query string params (34.3ms) [L#84] + * test Updating record metadata can navigate to the record edit form [L#196] * test Updating record metadata can navigate to the record edit form (4.8ms) [L#196] + * test Importing a new record it imports a record when selected [L#269] * test Importing a new record it imports a record when selected (13.9ms) [L#269] + * test Importing a new record it shows the import modal [L#255] * test Importing a new record it shows the import modal (2.4ms) [L#255] + * test Collection does not show wishlist records [L#35] * test Collection does not show wishlist records (76.0ms) [L#35] + * test Tagged search supports filters [L#148] * test Tagged search supports filters (27.0ms) [L#148] + * test Updating record metadata can change the record cover [L#210] * test Updating record metadata can change the record cover (20.6ms) [L#210] + * test Tagged search supports raw queries [L#125] * test Tagged search supports raw queries (18.7ms) [L#125] + * test Collection shows purchased records [L#46] * test Collection shows purchased records (58.0ms) [L#46] + +Finished in 0.8 seconds (0.2s async, 0.6s sync) + +Top 5 slowest (0.3s), 36.2% of total time: + + * test Wishlist can purchase a record and move it to the collection (MusicLibraryWeb.WishlistLive.IndexTest) (82.7ms) [test/music_library_web/live/wishlist_live/index_test.exs:15] + * test Collection does not show wishlist records (MusicLibraryWeb.CollectionLive.IndexTest) (76.0ms) [test/music_library_web/live/collection_live/index_test.exs:35] + * test Collection shows purchased records (MusicLibraryWeb.CollectionLive.IndexTest) (58.0ms) [test/music_library_web/live/collection_live/index_test.exs:46] + * test resize/1 it resizes to the desired size (MusicLibrary.Records.CoverTest) (56.7ms) [test/music_library/records/cover_test.exs:7] + * test renders 404.html (MusicLibraryWeb.ErrorHTMLTest) (46.2ms) [test/music_library_web/controllers/error_html_test.exs:7] + +1 doctest, 85 tests, 0 failures diff --git a/lib/music_library_web/components/record_components.ex b/lib/music_library_web/components/record_components.ex index c0969dbd..3dcb3b80 100644 --- a/lib/music_library_web/components/record_components.ex +++ b/lib/music_library_web/components/record_components.ex @@ -209,12 +209,12 @@ defmodule MusicLibraryWeb.RecordComponents do """ end - defp toggle_actions_menu(record_id) do + def toggle_actions_menu(record_id) do JS.toggle(to: "#actions-#{record_id}") |> JS.toggle_class("pointer-events-none", to: "#records > li") end - defp close_actions_menu(record_id) do + def close_actions_menu(record_id) do JS.hide(to: "#actions-#{record_id}") |> JS.remove_class("pointer-events-none", to: "#records > li") end diff --git a/lib/music_library_web/live/collection_live/show.ex b/lib/music_library_web/live/collection_live/show.ex index 7ef1b336..544ab367 100644 --- a/lib/music_library_web/live/collection_live/show.ex +++ b/lib/music_library_web/live/collection_live/show.ex @@ -1,8 +1,8 @@ defmodule MusicLibraryWeb.CollectionLive.Show do use MusicLibraryWeb, :live_view + import MusicLibraryWeb.RecordComponents, only: [toggle_actions_menu: 1, close_actions_menu: 1] alias Phoenix.LiveView.JS - alias MusicLibrary.Records @impl true @@ -137,14 +137,4 @@ defmodule MusicLibraryWeb.CollectionLive.Show do defp title_segment(:show), do: gettext("Show") defp title_segment(:edit), do: gettext("Edit") - - defp toggle_actions_menu(record_id) do - JS.toggle(to: "#actions-#{record_id}") - |> JS.toggle_class("pointer-events-none", to: "#records > li") - end - - defp close_actions_menu(record_id) do - JS.hide(to: "#actions-#{record_id}") - |> JS.remove_class("pointer-events-none", to: "#records > li") - end end diff --git a/lib/music_library_web/live/record_live/import_component.ex b/lib/music_library_web/live/record_live/import_component.ex index c89a8929..6c6b5571 100644 --- a/lib/music_library_web/live/record_live/import_component.ex +++ b/lib/music_library_web/live/record_live/import_component.ex @@ -1,6 +1,7 @@ defmodule MusicLibraryWeb.RecordLive.ImportComponent do use MusicLibraryWeb, :live_component + import MusicLibraryWeb.RecordComponents, only: [toggle_actions_menu: 1, close_actions_menu: 1] alias MusicLibrary.Records @impl true @@ -152,14 +153,4 @@ defmodule MusicLibraryWeb.RecordLive.ImportComponent do defp search(mb_query) do Records.search_release_group(mb_query, limit: 10) end - - defp toggle_actions_menu(record_id) do - JS.toggle(to: "#actions-#{record_id}") - |> JS.toggle_class("pointer-events-none", to: "#records > li") - end - - defp close_actions_menu(record_id) do - JS.hide(to: "#actions-#{record_id}") - |> JS.remove_class("pointer-events-none", to: "#records > li") - end end diff --git a/lib/music_library_web/live/wishlist_live/show.ex b/lib/music_library_web/live/wishlist_live/show.ex index a794f80c..2392ff20 100644 --- a/lib/music_library_web/live/wishlist_live/show.ex +++ b/lib/music_library_web/live/wishlist_live/show.ex @@ -1,6 +1,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do use MusicLibraryWeb, :live_view + import MusicLibraryWeb.RecordComponents, only: [toggle_actions_menu: 1, close_actions_menu: 1] alias MusicLibrary.Records @impl true @@ -134,14 +135,4 @@ defmodule MusicLibraryWeb.WishlistLive.Show do defp title_segment(:show), do: gettext("Show") defp title_segment(:edit), do: gettext("Edit") - - defp toggle_actions_menu(record_id) do - JS.toggle(to: "#actions-#{record_id}") - |> JS.toggle_class("pointer-events-none", to: "#records > li") - end - - defp close_actions_menu(record_id) do - JS.hide(to: "#actions-#{record_id}") - |> JS.remove_class("pointer-events-none", to: "#records > li") - end end diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 5184b058..fe893568 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -53,7 +53,7 @@ msgstr "" #: lib/music_library_web/components/record_components.ex:161 #: lib/music_library_web/live/collection_live/show.ex:139 #: lib/music_library_web/live/collection_live/show.html.heex:70 -#: lib/music_library_web/live/wishlist_live/show.ex:136 +#: lib/music_library_web/live/wishlist_live/show.ex:137 #: lib/music_library_web/live/wishlist_live/show.html.heex:70 #, elixir-autogen, elixir-format msgid "Edit" @@ -146,7 +146,7 @@ msgstr "" msgid "No cover selected" msgstr "" -#: lib/music_library_web/live/record_live/import_component.ex:45 +#: lib/music_library_web/live/record_live/import_component.ex:46 #, elixir-autogen, elixir-format msgid "No results" msgstr "" @@ -197,7 +197,7 @@ msgstr "" #: lib/music_library_web/live/record_live/form_component.ex:123 #: lib/music_library_web/live/wishlist_live/index.ex:148 -#: lib/music_library_web/live/wishlist_live/show.ex:105 +#: lib/music_library_web/live/wishlist_live/show.ex:106 #, elixir-autogen, elixir-format msgid "Record updated successfully" msgstr "" @@ -222,19 +222,19 @@ msgstr "" msgid "Search" msgstr "" -#: lib/music_library_web/live/record_live/import_component.ex:23 +#: lib/music_library_web/live/record_live/import_component.ex:24 #, elixir-autogen, elixir-format msgid "Search for a record on MusicBrainz" msgstr "" -#: lib/music_library_web/live/record_live/import_component.ex:24 +#: lib/music_library_web/live/record_live/import_component.ex:25 #, elixir-autogen, elixir-format msgid "Search for records" msgstr "" #: lib/music_library_web/components/record_components.ex:141 #: lib/music_library_web/live/collection_live/show.ex:138 -#: lib/music_library_web/live/wishlist_live/show.ex:135 +#: lib/music_library_web/live/wishlist_live/show.ex:136 #, elixir-autogen, elixir-format msgid "Show" msgstr "" @@ -264,7 +264,7 @@ msgstr "" #: lib/music_library_web/live/collection_live/index.ex:21 #: lib/music_library_web/live/collection_live/show.ex:12 #: lib/music_library_web/live/wishlist_live/index.ex:21 -#: lib/music_library_web/live/wishlist_live/show.ex:10 +#: lib/music_library_web/live/wishlist_live/show.ex:11 #, elixir-autogen, elixir-format msgid "The application has been updated, please reload." msgstr "" @@ -308,7 +308,7 @@ msgstr "" #: lib/music_library_web/components/layouts/app.html.heex:20 #: lib/music_library_web/live/artist_live/show.html.heex:72 #: lib/music_library_web/live/wishlist_live/index.ex:83 -#: lib/music_library_web/live/wishlist_live/show.ex:129 +#: lib/music_library_web/live/wishlist_live/show.ex:130 #, elixir-autogen, elixir-format msgid "Wishlist" msgstr "" @@ -341,7 +341,7 @@ msgstr "" msgid "Scrobble activity" msgstr "" -#: lib/music_library_web/live/record_live/import_component.ex:80 +#: lib/music_library_web/live/record_live/import_component.ex:81 #: lib/music_library_web/live/stats_live/index.html.heex:169 #, elixir-autogen, elixir-format msgid "Choose which format to import" @@ -370,13 +370,13 @@ msgid "Includes" msgstr "" #: lib/music_library_web/live/collection_live/show.ex:54 -#: lib/music_library_web/live/wishlist_live/show.ex:52 +#: lib/music_library_web/live/wishlist_live/show.ex:53 #, elixir-autogen, elixir-format msgid "Error refreshing MusicBrainz data" msgstr "" #: lib/music_library_web/live/collection_live/show.ex:46 -#: lib/music_library_web/live/wishlist_live/show.ex:44 +#: lib/music_library_web/live/wishlist_live/show.ex:45 #, elixir-autogen, elixir-format msgid "MusicBrainz data refreshed successfully" msgstr "" @@ -387,12 +387,12 @@ msgid "Refresh LastFm Feed" msgstr "" #: lib/music_library_web/live/collection_live/show.ex:86 -#: lib/music_library_web/live/wishlist_live/show.ex:64 +#: lib/music_library_web/live/wishlist_live/show.ex:65 #, elixir-autogen, elixir-format msgid "Cover refreshed successfully" msgstr "" -#: lib/music_library_web/live/wishlist_live/show.ex:72 +#: lib/music_library_web/live/wishlist_live/show.ex:73 #, elixir-autogen, elixir-format msgid "Error refreshing Cover" msgstr "" @@ -459,13 +459,13 @@ msgid "Loading play count" msgstr "" #: lib/music_library_web/live/collection_live/show.ex:74 -#: lib/music_library_web/live/wishlist_live/show.ex:92 +#: lib/music_library_web/live/wishlist_live/show.ex:93 #, elixir-autogen, elixir-format msgid "Error populating genres" msgstr "" #: lib/music_library_web/live/collection_live/show.ex:66 -#: lib/music_library_web/live/wishlist_live/show.ex:84 +#: lib/music_library_web/live/wishlist_live/show.ex:85 #, elixir-autogen, elixir-format msgid "Genres populated successfully" msgstr ""