Files
music_library/backlog/tasks/ml-182.3 - Wave-3-Convert-live-2-→-visit-2-for-CRUD-LiveViews-6-files.md
T
2026-05-15 07:04:04 +01:00

2.5 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, modified_files, parent_task_id, priority, ordinal
id title status assignee created_date updated_date labels dependencies modified_files parent_task_id priority ordinal
ML-182.3 Wave 3: Convert live/2 → visit/2 for CRUD LiveViews (6 files) In Progress
2026-05-14 22:14 2026-05-15 06:01
testing
refactoring
test/music_library_web/live/maintenance_live/index_test.exs
test/music_library_web/live/online_store_template_live/index_test.exs
test/music_library_web/live/record_set_live/index_test.exs
test/music_library_web/live/record_set_live/show_test.exs
test/music_library_web/live/scrobble_rules_live/index_test.exs
test/music_library_web/live/scrobbled_tracks_live/rule_picker_test.exs
ML-182 medium 13000

Description

Convert live/2visit/2 for standard CRUD LiveViews. Files:

  • maintenance_live/index_test.exs Done (14 tests pass)
  • online_store_template_live/index_test.exs Done (7 tests pass)
  • record_set_live/index_test.exs Done (7 tests pass)
  • record_set_live/show_test.exs Done (15 tests pass)
  • scrobble_rules_live/index_test.exs Done (10 tests pass) — removed import Phoenix.LiveViewTest, added explicit only: for render_change/1 and form/3. Fluxon <.select> component requires unwrap with form/3 + render_change/1 for type changes — standard PhoenixTest.select/3 doesn't work with custom selects. Dynamic label ("Match Value"/"Album Title"/"Artist Name") handled via set_rule_type helper. Edit validation test uses unwrap with render_change to clear existing data before checking errors. Path assertions on patch links omit query params (not captured by PhoenixTest). Buttons: "Add" (link), "Save Rule", "Apply", "Apply rule", "Delete", "Disable rule"/"Enable rule".
  • scrobbled_tracks_live/rule_picker_test.exs ⏸️ Blocked: clicks <span> badges with phx-click (Fluxon). PhoenixTest only supports <a> and <button>.

Key learnings for remaining files:

  • Fluxon custom <.select> components are NOT native <select> elements — use unwrap with form/3 + render_change/1 instead of PhoenixTest.select/3
  • For edit-form validation tests where existing data would pass validation, unwrap with render_change clears fields first
  • assert_path on patch links doesn't capture query params — use path-only assertions
  • <li phx-click> needs unwrap with element/2 + render_click/1 since PhoenixTest only supports <a> and <button> natively