-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marcel/submit with button #94
Conversation
b5b10b5
to
a97db01
Compare
- This allows users to specify the button they want to submit the form with. - If the button that's submitted has a `name`it will show up in the params.
834c5dc
to
89cee46
Compare
Codecov Report
@@ Coverage Diff @@
## marcel/submit-form #94 +/- ##
=======================================================
- Coverage 93.67% 78.53% -15.14%
=======================================================
Files 9 9
Lines 158 191 +33
=======================================================
+ Hits 148 150 +2
- Misses 10 41 +31
Continue to review full report at Codecov.
|
@@ -78,6 +77,14 @@ defmodule TestDispatch do | |||
def submit_form(conn, attrs, entity, test_selector), | |||
do: dispatch_form(conn, attrs, entity, test_selector) | |||
|
|||
@spec submit_form(Plug.Conn.t(), %{}, binary()) :: Plug.Conn.t() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spec submit_form(Plug.Conn.t(), %{}, binary()) :: Plug.Conn.t() | |
@spec submit_with_button(Plug.Conn.t(), %{}, binary()) :: Plug.Conn.t() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
input_submit || button_submit | ||
end | ||
|
||
def text(html_tree), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def text(html_tree), | |
defp text(html_tree), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah i'm moving this later in #97.
def text(html_tree), | ||
do: html_tree |> Floki.text() |> String.replace(~r/\s+/, " ") |> String.trim() | ||
|
||
defp all_buttons(html_tree) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defp all_buttons(html_tree) do | |
defp all_submit_controls(html_tree) do |
or something like it? :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah nice i'll update this in #97
No description provided.