germsvel / phoenix_test

MIT License
144 stars 20 forks source link

Fix: Deep merge nested form button value (static) #75

Closed ftes closed 3 months ago

ftes commented 3 months ago

Given a "static" form

<input name="user[name]" value="Ada" />
<button name="user[action]" value="save">Save</button>

When I click on the "Save" button

Then (actual behaviour) this is submitted

form_data = %{"user" => %{"name" => "Ada"}}

Instead of (expected behaviour)

form_data = %{"user" => %{"name" => "Ada", "action" => "save"}}

Remarks

Already correctly implemented by LiveView test.