From dda700ad9666bf52446fe695af11543e938b87f7 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 14 May 2026 23:20:52 +0100 Subject: [PATCH] ML-182: convert 4 test files to PhoenixTest only Waves 1-2: scrobble_live/index, scrobbled_tracks_live/index, release_group_show, release_show. Dropped unwrap/2 bridges and page_title/1 usage. Search form tests use visit with query params. page_title tests use assert_has("title", ...). --- ...eViewTest-usage-in-favor-of-PhoenixTest.md | 103 +++--------------- ...e-and-scrobbled_tracks_live-index-tests.md | 29 +++++ ...-in-release_group_show-and-release_show.md | 25 +++++ .../live/scrobble_live/index_test.exs | 44 ++------ .../scrobble_live/release_group_show_test.exs | 8 +- .../live/scrobble_live/release_show_test.exs | 13 +-- .../live/scrobbled_tracks_live/index_test.exs | 33 +----- 7 files changed, 89 insertions(+), 166 deletions(-) create mode 100644 backlog/tasks/ml-182.1 - Wave-1-Drop-unwrap-2-bridges-in-scrobble_live-and-scrobbled_tracks_live-index-tests.md create mode 100644 backlog/tasks/ml-182.2 - Wave-2-Convert-page_title-1-tests-in-release_group_show-and-release_show.md diff --git a/backlog/tasks/ml-182 - Analyze-and-plan-elimination-of-LiveViewTest-usage-in-favor-of-PhoenixTest.md b/backlog/tasks/ml-182 - Analyze-and-plan-elimination-of-LiveViewTest-usage-in-favor-of-PhoenixTest.md index 040d631c..33e4bbf7 100644 --- a/backlog/tasks/ml-182 - Analyze-and-plan-elimination-of-LiveViewTest-usage-in-favor-of-PhoenixTest.md +++ b/backlog/tasks/ml-182 - Analyze-and-plan-elimination-of-LiveViewTest-usage-in-favor-of-PhoenixTest.md @@ -1,10 +1,10 @@ --- id: ML-182 title: Analyze and plan elimination of LiveViewTest usage in favor of PhoenixTest -status: To Do +status: In Progress assignee: [] created_date: "2026-05-14 21:40" -updated_date: "2026-05-14 21:41" +updated_date: "2026-05-14 22:15" labels: - testing - refactoring @@ -43,9 +43,9 @@ ordinal: 10000 -Audit all LiveView and component tests that use LiveViewTest (either exclusively or mixed with PhoenixTest) and determine which can be converted to use only PhoenixTest. The project's ConnCase auto-imports both PhoenixTest (full) and Phoenix.LiveViewTest (subset via `only:`), creating a dual-framework testing situation. The goal is to reduce complexity by eliminating LiveViewTest usage where possible. +Audit all LiveView and component tests that mix LiveViewTest and PhoenixTest, and eliminate LiveViewTest usage where possible. The project's ConnCase auto-imports both frameworks, creating unnecessary dual-framework complexity. -An initial analysis of 17 files has been completed. The task is to refine this analysis and produce a concrete migration plan with cost estimates. +The work is broken into 6 waves by difficulty, each tracked as a subtask. @@ -53,100 +53,25 @@ An initial analysis of 17 files has been completed. The task is to refine this a -- [ ] #1 All 17 files are classified as fully eliminable, partially eliminable, or blocked with clear rationale for each -- [ ] #2 Three blocking patterns (send_update/3, send(view.pid), live_isolated) are documented with suggested workarounds -- [ ] #3 A concrete migration order is proposed, prioritizing low-risk fully-eliminable files first -- [ ] #4 Cost estimates (effort level: low/medium/high) are assigned to each file or group of files +- [x] #1 All 17 files are classified as fully eliminable, partially eliminable, or blocked with clear rationale for each +- [x] #2 Three blocking patterns (send_update/3, send(view.pid), live_isolated) are documented with suggested workarounds +- [x] #3 A concrete migration order is proposed, prioritizing low-risk fully-eliminable files first +- [x] #4 Cost estimates (effort level: low/medium/high) are assigned to each file or group of files ## Implementation Notes -## Initial Analysis (completed 2026-05-14) +## Key challenges discovered during execution -### Context +1. **PhoenixTest can't click `` elements** (Fluxon `.badge`) β€” only `` (`click_link`) and `