2.0 KiB
2.0 KiB
id, title, status, assignee, created_date, labels, dependencies, references, priority
| id | title | status | assignee | created_date | labels | dependencies | references | priority | |
|---|---|---|---|---|---|---|---|---|---|
| ML-4 | Improve test coverage for LiveHelpers.RecordActions and Components.Chat | Done | 2026-04-20 08:48 |
|
medium |
Description
GitHub: created 2026-04-16 · updated 2026-04-17 · closed 2026-04-17
Summary
Two shared/user-facing surfaces have low test coverage despite contributing real behaviour:
MusicLibraryWeb.LiveHelpers.RecordActions— 9.09 % coverage. Shared handler used by both Collection and Wishlist show pages.MusicLibraryWeb.Components.Chat— 25.87 % coverage. The streaming AI chat sheet used on Collection/Wishlist/Artist pages.
Evidence
From mix test --cover in the 2026-04-16 audit:
LiveHelpers.RecordActions— 9.09 %Components.Chat— 25.87 %StatsLive.TopAlbums— 20-30 %StatsLive.TopArtists— 30-39 %
Both LiveHelpers.RecordActions and Components.Chat contain branches for error paths (refresh failures, streaming errors) that are not exercised.
Fix
- For
LiveHelpers.RecordActions: unit-test each handler (refresh_cover,populate_genres,generate_embeddings,refresh_musicbrainz_data) both the success and error branches. These can be tested viaPhoenix.LiveViewTestagainst either Collection or Wishlist Show. - For
Components.Chat: test the streaming state transitions (starting, receiving chunks, error, completed) and the message submission path. Streaming can be faked viaReq.Testor behaviour stubs.
Acceptance Criteria
LiveHelpers.RecordActionsreaches at least 70 % line coverageComponents.Chatreaches at least 60 % line coverage- Both happy and error paths covered
- #1
LiveHelpers.RecordActionsreaches at least 70 % line coverage - #2
Components.Chatreaches at least 60 % line coverage - #3 Both happy and error paths covered