3.5 KiB
3.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 05:46 |
|
|
ML-182 | medium | 13000 |
Description
Convert live/2 → visit/2 for standard CRUD LiveViews. Files:
- maintenance_live/index_test.exs ✅ Done (14 tests pass) — all
live/2→visit/2,render_click/3→click_button/2with scoped selectors for duplicate button texts. External redirect test simplified. Keptunwrap(&render_async/1)for async status tests. - online_store_template_live/index_test.exs ✅ Done (7 tests pass) — mixed
visit/2andlive/2eliminated. Field labels: "Template Name", "URL Template". Buttons: "Save Template", "Delete", "Disable/Enable template". - record_set_live/index_test.exs ✅ Done (7 tests pass) — removed
import Phoenix.LiveViewTest. Create/Edit:live/2+form/3+render_submit/1→visit/2+fill_in/3+click_button/2. Validation:live/2+form/3+render_change/1→visit/2+click_button/2+assert_has("[data-part='error']", ...). Ordering test:live/2→visit/2+Phoenix.LiveViewTest.render(session.view). Button text: "Save Set", field label: "Name". - record_set_live/show_test.exs ✅ Done (15 tests pass) — removed
import Phoenix.LiveViewTest, replaced with explicitonly:forrender_click/1, render_hook/3, render_submit/1, element/2, form/3. Remove record:click_button("button[...]", "Remove"). Delete set:click_button("button[phx-click='delete_set']", "Delete")+assert_path. Reorder:unwrap(&render_hook/3). Picker search:search_pickerhelper usesunwrapwithform/3+render_submit/1. Add record:unwrapwithelement/2+render_click/1on<li phx-click='add_record'>. Result checks useassert_has/refute_hasinstead of=~andhas_element?. - scrobble_rules_live/index_test.exs ⏸️ Needs form label inspection — "Match Value", "Target MusicBrainz ID", "Type" select, "Save" button.
- scrobbled_tracks_live/rule_picker_test.exs ⏸️ Blocked: clicks
<span>badges withphx-click(Fluxon). PhoenixTest only supports<a>and<button>.
Key learnings for remaining files:
click_button(session, "button[phx-click='...']", "text")scoped selector works for duplicate button texts- Fluxon labels without separate visible text don't work with
fill_in— visit with query params instead trigger_hookin PhoenixTest expects JSON-encoded values- LiveComponent modals with
phx-targetneed form interaction, not URL params - For position-based assertions (ordering), use
Phoenix.LiveViewTest.render(session.view)to get raw HTML <li phx-click>needsunwrapwithelement/2+render_click/1since PhoenixTest only supports<a>and<button>natively- Forms inside LiveComponents (phx-target={@myself}) with no visible label on inputs need
unwrapwithform/3+render_submit/1for search/submit operations